In front of a crowd of 21,000, Morocco surged into a 2-0 lead by the 24th minute. Ghizlane Chebbak opened the scoring in the 12th with a rising shot after a failed Nigerian clearance, before Sanaa Mssoudy ended her five-match goal drought with a low strike into the far corner.
However, Nigeria responded in style. Esther Okoronkwo began the comeback in the 64th minute, converting a penalty following a VAR review which confirmed a handball by Nouhaila Benzina.
Okoronkwo then turned provider, setting up Folashade Ijamilusi's equaliser in the 71st minute. Substitute Jennifer Echegini sealed the win in the 88th minute, finishing from an Okoronkwo-delivered free-kick.
Okoronkwo was the standout performer with a goal and two assists, while Nigerian keeper Chiamaka Nnadozie was left helpless on Morocco's first goal.
Morocco's Khadija Er-Rmichi conceded all three goals in a turbulent second half as the North Africans suffered their second successive final defeat.
On Friday, Ghana clinched third place with a 4-3 penalty shootout win over South Africa following a 1-1 draw in Casablanca. South Africa led through Nonhlanhla Mthandi's 45th-minute goal after a costly error from Ghana keeper Cynthia Konlan.
The Ghanaians levelled in the 68th after Alice Kusi's header struck the bar, resulting in an own goal by Andile Dlamini.