An earlier 0-0 draw in the other Group L match between Lesotho and Sierra Leone in Maseru meant the Super Eagles became the 17th qualifiers for the tournament an hour before playing the Squirrels.
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 Saturday (AEDT) 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 has 11 points, Benin seven, Sierra Leone four and Lesotho three going into the final round of qualifiers on Wednesday (AEDT).
While three-time African champion Nigeria hosts Lesotho in Lagos with only pride at stake, Cup of Nations qualification will be on the line when Sierra Leone confronts 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 Monday (AEDT) in Omdurman with Sudan needing a win and South Africa at least a draw as they battle to join Ghana from Group C.