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 on 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.