Moroccan defender Romain Saiss scored the opening goal of the match in the first half after Galatasaray star Hakim Ziyech's free kick was parried out by the goalkeeper.
Olympique Marseille midfielder Azzedine Ounahi and Sevilla forward Youssef En-Nesyri were the other scorers for Morocco.
Tanzanian defender Novatus Miroshi was sent off after a foul in the second half while Morocco were on a 1-0 lead.
Group F leaders Morocco will next play DR Congo on Sunday.
In the other match of the group, DR Congo drew with Zambia 1-1 late Wednesday.
The Africa Cup of Nations, hosted by Ivory Coast, will run through Feb. 11.