Ex- African Footballer of the Year the Napoli star was instrumental in his team establish a commanding lead, but they were compelled to defend resolutely for a hard-fought win.
Nigeria weathered a dramatic late rally from Tunisia to progress to the last 16 of the Afcon tournament being held in Morocco.
The Super Eagles seemed to be cruising in their pool clash in the Moroccan city, enjoying a 3-0 cushion with just 17 minutes left thanks to goals from Victor Osimhen, Wilfred Ndidi and Ademola Lookman.
However, Montassar Talbi pulled one back with a powerful header from a Manchester United midfielder free-kick, sparking hopes of a turnaround.
The tension intensified when the North Africans were awarded a spot-kick after a VAR check identified a handball by Bright Osayi-Samuel. The left-back calmly slotted home in the dying stages to set up a frantic finale.
The Carthage Eagles came agonizingly close from a last-gasp leveler in stoppage time, with captain Ferjani Sassi heading a opportunity narrowly wide before a substitute guided a bobbling volley past the goal frame.
Securing Top Spot
The victory ensures that the Super Eagles, winners of the tournament on three past instances, move to 6 group points and are guaranteed first place in their pool with one game left to play.
For the round of 16, they will meet a best third-place team from either Group A, B or F.
In the other match, Tunisia stay on three points, with Uganda and Tanzania tied on one point after playing out a 1-1 stalemate earlier on Saturday.
The final group matches will see Nigeria stay in the city to take on Uganda on Tuesday, while Tunisia travel back to Rabat to confront Tanzania.
A Nervy Finish
Ali Abdi smashed the ball from 12 yards to offer his team a glimmer of hope of earning a draw.
Nigeria, finalists in the 2023 edition, are the second team after Egypt to qualify for the knockout stage, but coach Eric Chelle and fans will undoubtedly be breathing a sigh of relief.
What seemed set to be a comfortable last period morphed into a nerve-wracking conclusion.
The prolific striker had a effort disallowed for offside before breaking the deadlock right before half-time, precisely placing a header into the bottom corner from an Ademola Lookman cross.
The lead was doubled soon in the second period when Wilfred Ndidi climbed above everyone to power home a header from a set-piece kick.
Osimhen then turned provider his teammate for the third goal, only for Montassar Talbi to steer a header past the Nigerian shot-stopper to begin the fightback.
The key moment arrived when a looping cross struck the arm of Bright Osayi-Samuel, with the official pointing to the spot after consulting the VAR monitor.
Despite Ali Abdi's successful penalty, Tunisia in the end came up just short of pulling off a stirring recovery.
Their fate is still in their own hands; a draw against Tanzania will be enough to see them through, and manager Sami Trabelsi will be keen to prevent a repeat of the past early elimination that resulted in his previous resignation.