The hosts thought they had scored just four minutes later when Ayoub El Kaabi headed home, only for the assistant referee's flag to go up – claiming the corner had swung out of play before it reached the striker.
And they kept the Nigerian backline busy till the quarter-hour mark during which Ayoub El Kaabi was denied by the crossbar from a Zakaria Hadraf cross from the left.
Captain Badr Benoun went on a solo run beating two players and found Abdeljalil Jbira whose cross was slotted home by Hadraf to send the stadium into raptures.
Trailing by a lone goal, Nigeria’s chances of a comeback were dealt a severe blow two minutes after recess when Peter Moses was sent off for a second yellow card after fouling Hadraf.
El Kaabi finally registered his name of the scoring cards, firing past Ajiboye from close range on 74 minutes for his ninth of the competition, and seal victory.