Ex- African Footballer of the Year the Napoli star helped his team build a 3-0 advantage, before they were compelled to defend resolutely for a narrow win.
The three-time champions survived a stunning late rally from Tunisia to advance to the last 16 of the 2025 Africa Cup of Nations taking place in Morocco.
Jose Peseiro's side seemed to be in complete control in their Group C clash in Fes, holding a 3-0 cushion with only a quarter of an hour remaining courtesy of goals from Victor Osimhen, Wilfred Ndidi and Ademola Lookman.
Yet, Montassar Talbi reduced the deficit with a powerful header from a Manchester United midfielder free-kick, igniting hopes of a turnaround.
The tension intensified when Tunisia were given a late penalty after a video assistant referee review identified a handling offense by the Nigerian defender. Ali Abdi calmly slotted home in the dying stages to create a nail-biting conclusion.
Tunisia came agonizingly close from a last-gasp leveler in added time, with captain Ferjani Sassi directing a chance just past the post before a substitute guided a bobbling volley past the goal frame.
This result means that Nigeria, winners of the competition on 3 past instances, move to 6 group points and are assured first place in Group C with a match still to be contested.
In the next round, they will face a third-placed team from either Group A, B or F.
Meanwhile, the 2004 champions remain on 3 group points, with the East African teams locked on one point each after playing out a one-all stalemate earlier on Saturday.
The concluding pool matches will see Nigeria stay in Fes to play Uganda on the next matchday, while Tunisia travel back to the capital to confront Tanzania.
The Tunisian defender smashed home from 12 yards to give his team hope of snatching a draw.
Nigeria, runners-up in the 2023 tournament, are the second team after Egypt to qualify for the knockout stage, but their manager and fans will certainly be feeling relieved.
What looked like set to be a comfortable last period transformed into a nerve-wracking affair.
The prolific striker had a goal ruled out for an infringement before opening the scoring on the stroke of the interval, expertly guiding a glancing effort into the far post from an Atalanta winger cross.
The advantage was doubled early in the second period when the Leicester City midfielder climbed above everyone to power home a header from a set-piece corner.
The number 9 then set up his teammate for the third goal, before the defender to steer a header past the Nigerian shot-stopper to begin the comeback.
The key moment arrived when a looping cross hit the arm of the full-back, with referee Boubou Traore pointing to the spot after reviewing the pitchside screen.
Despite Ali Abdi's successful penalty, the 2004 champions ultimately fell short of completing a remarkable recovery.
Tunisia's destiny remains in their control; a point against Tunisia will be enough to secure progression, and manager Sami Trabelsi will be eager to prevent a recurrence of the past early elimination that led to his departure.