An Islamist opposition activist was sentenced to two years in jail on Wednesday by a military court for crossing illegally into the Gaza Strip.