A fifth-minute penalty converted by Hassan Yebda gave the 2010 World Cup finalists their first win in the tight Group 4, one day after Tanzania beat leaders Central African Republic.
The results left each team in the group with four points, but Central African Republic remained top with a better goal-difference.
Elsewhere, Botswana shocked the Dark Continent by becoming the first nation to qualify for the finals with a 1-0 victory over Chad.
Jerome Ramatlhakwane scored the only goal of the game to send the African minnows to their first-ever CAN finals with a superb 16 points from six games.
Elsewhere, Ghana and Sudan remained head to head in Group 9 with 3-0 victories over Congo and Swaziland respectively.
Didier Drogba scored twice to giver Ivory Coast a 2-1 win over Benin and maintain the Elephants’’ 100% record in Group 8.
Yebda penalty vs. Morocco