For the record, the Atlas Lions team now managed by Hervé Renard, was qualified in the past to the World Cup in 1970, 1986, 1994, 1998.
Tunisia guaranteed top spot in World Cup qualifying Group A and secured their ticket to Russian Federation despite being held 0-0 at home by Libya on Saturday. But it was the Moroccans who got the breakthrough when Nabil Dirar's cross evaded everyone and found its way it to the net.
Ivory Coast, who never looked like recovering from the first-half blows, came second with eight points followed by Gabon with six and Mali with four. Scoring two goals, Morocco has secured a ticket to Russian Federation.
Benatia scored with a first-time shot from a corner five minutes later to seal the victory.
Tunisia could not break down neighbours Libya in Rades on the outskirts of Tunis and had to settle for a 0-0 draw that was just enough to see them first over the finishing line.
The Leopards knew that they needed to beat already eliminated Guinea and hope that Libya downed Tunisia to overhaul the Eagles to top spot.
Ivory Coast, meanwhile, failed to qualify for the quadrennial tournament after making it to the competition's finals for three times in a row in 2006, 2010 and 2014. Before today's matches, Tunisia had 13 points while DR Congo had 10 points.
DR Congo defeated Guinea 3-1 but that did not matter as Tunisia had secured a point.
Jonathan Bolingi's penalty and a goal from Fulham's Neeskens Kebano, both in injury time, gave the Leopards all three points and left them hoping for a Libya victor, but Tunisia held firm to seal their ticket to Russian Federation.
Before Saturday, the trio of Nigeria, Egypt and Senegal had booked their tickets before the two North African countries also came on board to Russian Federation.