Tunisia claimed the other spot despite being held to a goalless draw at home by Libya in Group A of the African qualifiers.
Morocco's win in Abidjan gave coach Herve Renard success over his former team and the country he led to the African Cup title in 2015.
Seydou Doumbia had the best chance to score for the Elephants in the second half after being put through by Crystal Palace striker Wilfried Zaha, but he placed his shot well over the bar unmarked.
Tunisia and Morocco have completed the roster of teams that would represent Africa at the Russian Federation 2018 World Cup.
The match witnessed several incidents involving Zaha, Doumbia, Serge Aurier against their opponents as tension heightened.
Guinea's Ousmane Sidibe headed into his own net while defending a set piece after the hour mark, but the visitors were able to equalise 10 minutes later when Keita Karamokoba pounced on a loose ball and flicked it over DR Congo goalkeeper Ley Matampi.
However a brace of strikes in stoppage time, a Jonathan Bolingi penalty and through Neeskens Kebano sealed the win for DR Congo - but it was a hollow victory after Tunisia clinched the draw to top Group A by one point. While it scored eleven goals in six games, the national team did not concede a single goal.
Tunisia could not break down neighbour Libya in Rades on the outskirts of Tunis and had to settle for a 0-0 draw that was just enough to see it first over the finishing line and book a first World Cup appearance since 2006.