Afcon 2023: Nigeria qualify, Ghana stumble & Gabon lose
Ghana missed out on qualifying with a game to spare as they were held 0-0 in Madagascar.
Two points separate the Group E leaders from Angola in second and third-placed Central African Republic, whom they host on 3 September.
The Central African Republic, who could also have qualified, lost 2-1 at home to Angola.
Patson Daka and Kings Kangwa struck and Serge Aurier scored an own goal as Zambia beat hosts Ivory Coast 3-0 in Ndola to seal their Afcon place.
A late penalty gave Equatorial Guinea an impressive 1-0 win against Tunisia in Malabo that secure a second successive Afcon qualification, while Cape Verde, with a population less than 600,000, will make their fourth appearance at the tournament following a 3-1 home win over Group B winners Burkina Faso.
Mali secured top spot in Group G with a 2-0 win in Congo-Brazzaville, who face a winner-takes-all clash with the Gambia for the runners-up spot.
Hosts Ivory Coast, holders Senegal, Algeria, Egypt, Morocco, South Africa and Tunisia had already secured their spot in the 24-team Afcon, which was postponed to January next year because of the summer rainy season in West Africa.