The Super Eagles maintained top of Group L standings in the AFCON qualifier after a 93rd-minute winner from substitute Paul Onuachu on Saturday evening.
The Nigerian side had already booked their place in Cameroon after Lesotho and Sierra Leone played out a 0-0 draw earlier in the day, with Benin needing one point from the match against Nigeria to also secure a place at the finals of the competition.
A fourth consecutive goalless draw in the section seemed on the cards until giant substitute Onuachu reacted quickest when goalkeeper Saturnin Allagbe blocked a Victor Osimhen shot in Porto-Novo.
A combination of the woodwork, which foiled Osimhen, wild shooting and several superb saves by Allagbe had kept the match at Stade Charles de Gaulle goalless for 92 minutes.
The Super Eagles travelled by sea to the capital of Benin Friday after players raised concerns about the poor road network linking the neighbouring west African countries.
A few hours later, the visitors trained at the match venue using the light of a full moon because the floodlights were not switched on.
Nigeria have 11 points, Benin seven, Sierra Leone four and Lesotho three going into the final round of qualifiers Tuesday.
While three-time African champions Nigeria host Lesotho in Lagos with only pride at stake, Cup of Nations qualification will be on the line when Sierra Leone confront Benin in Freetown.
Algeria, Burkina Faso, Cameroon, Comoros, Egypt, Equatorial Guinea, Gabon, Gambia, Ghana, Guinea, Ivory Coast, Mali, Morocco, Senegal, Tunisia and Zimbabwe have also qualified, leaving seven places to be filled.
The first of those will be decided on Sunday in Omdurman with Sudan needing a win and South Africa at least a draw as they battle to join Ghana from Group C