Gabon's striker, Dénis Bouanga, fired first in the 5th minute before the Atlas Lions retaliated with a downpour of goals scored by Jamal Harkass (17'), Brahim Diaz (21', 23'), Youssef En-Nesyri (81') and Ismael Saibari (90').
In the same group, Lesotho beat the Central African Republic on Thursday (1-0).
Following today's fixtures, Morocco consolidated their position at the top of Group B with 15 points from five wins, ahead of Gabon, who qualified for the CAN (7 points). Lesotho are third with 4 points, while the Central African Republic are dead last with 3 points.