The Elephants dominated possession in the first half, but the best chance of the half fell to Morocco in the 26th minute.
Mourad Batna beat his man on the right flank and crossed the ball into the area. Abdelahim Khadrouf tried to beat the keeper with a clever back heel, but Ali Sangare was equal to the task.
The game was headed for a draw when the referee awarded Ivory Coast a penalty on the stroke of half-time. Abderrahim Achchakir was adjudged to have fouled Junior Djobo inside the penalty area.
Zakri stepped up and converted the penalty to give Ivory Coast the lead at half-time.