Yannick Zakri’s penalty at the stroke of half-time was enough to give the Elephants their first win of the tournament.
Ivory Coast, who are on three points, are now second in Group A behind hosts Rwanda with one last game to go.
Rwanda who have already qualified for the quarters are on six points.
Morocco are tied with Gabon on one point each.
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.
The second half was a dull affair with few chances created.