Algeria's national coach Abdelhak Benchikha has quit his post.
It was sweet revenge for Morocco who lost 1-0 to their North African neighbours in the qualifying competition three months ago.
Benchikha has previously coached clubs in his homeland, Qatar and Tunisia as well as the Algerian Olympic team.
He survived just three competitive matches after succeeding veteran Rabah Saadane in October last year
Saadane quit after a 1-1 home draw with Tanzania in their opening 2012 Cup of Nations qualifier and Benchikha made a disastrous debut as the Desert Foxes crashed 2-0 away to football lightweights Central African Republic.
The home win over Morocco offered hope that Algeria could mount a serious challenge for Group D honours, but Saturday's mauling in Marrakech leaves them with little hope of reaching Gabon and Equatorial Guinea next year.
Algeria's next qualifier is at home to Tanzania in September.
Morocco have seven points and Central African Republic, Tanzania and Algeria four each with only the group winners guaranteed a place at the African football showcase.
Gerets has vowed to win titles for Morocco, whose only Cup of Nations title came 35 years ago in Ethiopia when just eight teams competed and a mini-league format was used throughout the competition for the only time.
"I won a lot of titles as a footballer and a coach and I want to win titles with the Moroccan team too," the former Belgium international said after his appointment.
He won league titles with Lierse and Club Bruges in Belgium, PSV Eindhoven in the Netherlands and Galatasaray in Turkey and also coached French outfit Marseille before moving to Saudi Arabian side Al-Hilal.