Egypt, who had already qualified for the World Cup, drew in Ghana in the last game of Group E in Cape Coast on Sunday.
Ghana, who had played at the past three World Cup finals, finished a disappointing third in the standings behind Egypt and Uganda.
Egypt’s Mahmoud Abdelrazek opened the scoring with a left-footed strike in the 62nd minute but Netherlands-born striker Edwin Gyasi equalised just two minutes later with a deflected effort from outside the area.
It was a first international goal and only a second cap for the 26-year-old Gyasi, who plays his club football in Norway.
Egypt secured qualification for next year’s tournament in Russia when they beat Congo in Alexandria last month.
It will be their first World Cup since the 1990 finals in Italy.
Earlier in Brazzaville, Uganda secured second place in the group with a 1-1 draw against Congo.
Marvin Baudry put the hosts ahead after 10 minutes, but the Cranes hit back just one minute later through Milton Karisa to earn a point.
That draw left them four points behind Egypt in the final Group E standings.