Ziyech made his return to Herve Renard’s side for the first time since he was snubbed for the Nations Cup in Gabon in January this year.
The 24-year-old opened the scoring via a 19th-minute penalty to give the hosts the lead at Stade Prince Moulay Abdallah in Rabat.
Turkish based attacker Khalid Boutaib doubled Morocco’s lead soon thereafter as Renard’s men took the two goal lead to the interval.
In the seconds half, Ziyech stunned the 55000 crowd with a brilliant solo effort to make it 3-0.
The Dutch based attacker dribbled his way past a few challenges before stunningly finishing from an impossible angle in the 67th minute.
He would later setup Real Madrid defender Achraf Hakimi with a sublime through ball in the 72nd minute.
Faycal Fajr and Mimoun Mahi scored the last two goals for Morocco in the 86th and 89th minutes respectively.
The win leaves Morocco second in Group C with five points from three matches, two points above first placed Cote d’Ivoire who thrashed Gabon on Saturday.