Lorenzo Insigne came off the bench to score an injury-time winner as Napoli cemented second place in Serie A with a hard-fought 3-2 win over Cagliari on Sunday.
With AC Milan away to Juventus later Sunday Napoli could ill afford to drop points as they look to secure the runner-up spot which offers direct qualification for next season's Champions League.
However for over 90 minutes that looked to be the case as Cagliari stemmed the Napoli tide until Insigne's deflected shot from 25 metres handed the Neapolitans all three points in the fourth minute of injury time.
Napoli are now eight points behind Juventus ahead of Sunday's late game in Turin where AC Milan, in third, will be looking to close their seven-point gap to second place, especially after Fiorentina's 4-3 win over a fiesty Torino.
La Viola remain in fourth spot, now just one point behind Milan and five ahead of Inter, but they were in danger of dropping points until Brazilian midfielder Romulo came off the bench to clinch a late winner for Vincenzo Montella's side.
Fiorentina had a 3-1 half-time lead after goals from Juan Cuadrado, Alberto Aquilani and a superb free-kick from Adem Ljajic, with Brazilian Paulo Barreto sneaking a goal for the visitors just before half-time.
Argentinian Mario Santania sparked Torino's fightback and then it was all square at 3-3 when striker Alessio Cerci beat Emiliano Viviano with a superb drive from 30 metres,
Fiorentina's win was all the more crucial given that Roma, one of several teams chasing a Europa League place, dropped points in a 1-1 draw at home to bottom side Pescara.
Earlier Sunday veteran striker Tommaso Rocchi saved Inter's blushes with a late strike which secured a 1-0 win over a resilient Parma, a goal which took on even more importance for the Nerazzurri after Roma's failure to clinch a win that would have allowed the Giallorossi to leapfrog Inter into fifth place.
Napoli dominated throughout at the San Paulo however the hosts were stunned in the 18th minute when Victor Ibarbo opened the scoring for the Sardinians.
Highly-rated Urugayan striker Edinson Cavani, the league's top scorer, spurned several chances to level and it took an own goal from defender Davide Astori to pull the match level.
Cavani finally got on the scoresheet in the 64th minute, scoring his 23rd goal in 30 appearances this season when he pounced on a rebound to the left of goal.
However, the hosts were pegged back only minutes later when Marco Sau levelled for the visitors.
It took a deflection from Insigne's speculative effort on the left to bag all three points for Walter Mazzarri's side, who are desperate for the Champions League having missed out after failing to qualify earlier in the season.