The Super Eagles were forced to come from behind after Madagascar made the perfect start, with Ehsan Kari opening the scoring in the 16th minute.
Nigeria responded before the break through George Ilenikhena, who was making his competitive debut for the Super Eagles.
The hosts continued to push for the winner after the restart and were rewarded in the 65th minute when Moses Usor, also making his first competitive debut, found the back of the net to complete the comeback and secure maximum points for Nigeria.
Elsewhere, former France international Patrick Vieira began his reign as Senegal coach with a 1-1 draw against Mozambique at the Estadio Nacional do Zimpeto.
Nicolas Jackson put Senegal in front in the 32nd minute, giving the visitors the advantage as they looked set to begin Vieira's tenure with a victory.
However, Sporting Lisbon forward Geny Catamo restored parity for Mozambique on the stroke of half-time, with neither side able to find a winner after the break as the points were shared.
There was also celebration for Guinea-Bissau at the Amaan Stadium, where they secured a 2-0 victory over Tanzania.
Goals from Franculino and Mama Balde were enough to seal the win and give Guinea-Bissau a positive start to their qualifying campaign.
At the Cairo International Stadium, Egypt were held to a goalless draw by Angola.
The Pharaohs dominated large periods of the contest but were unable to convert their chances, with Angola holding firm under pressure to claim a point away from home.
Rest of Friday's results
Niger 2-1 Lesotho
Morocco 2-0 Gabon
Mali 3-1 Cape Verde
Togo 1-0 Burundi
Gambia 2-1 Somalia
Burkina Faso 1-1 Benin
Algeria 3-1 Zambia
Malawi 2-1 South Sudan
Rwanda 3-1 Liberia