Matteo Politano struck deep into injury time to snatch a 2-1 win for Napoli over Udinese in Serie A on Sunday as SPAL were relegated after falling to fellow strugglers Brescia.
Napoli, already qualified for the Europa League thanks to their Italian Cup victory, move back sixth ahead of AC Milan with four games to play.
Gennaro Gattuso's side are out of the running for the Champions League next season but are preparing to meet Barcelona in the second leg of their last 16 tie in this year's edition, with both sides locked at 1-1.
Rodrigo De Paul had put 16th-placed Udinese ahead after 22 minutes at the San Paolo Stadium before Arkadiusz Milik came off the bench to pull the hosts level nine minutes later.
Politano, on-loan from Inter Milan, blasted in the winner five minutes into injury time for his first goal for the southerners who bounced back after two consecutive draws.
Roma, in fifth, host second-placed Inter Milan later on Sunday, with Antonio Conte's side looking to move three points behind leaders Juventus, who host Lazio on Monday.
At the bottom of the table Brescia, in 19th, won 2-1 to condemn SPAL to a return to Serie B after two seasons in the top flight.
In another relegation dogfight Genoa beat Lecce 2-1 to move four points clear of the southerners who occupy the final relegation spot.
Genoa are four points behind Torino, who lost 2-0 at Fiorentina.
City rivals Sampdoria are on the brink of securing Serie A survival after staging a thrilling comeback from two goals down to win 3-2 at Parma.
Fabio Quagliarella scored one and set up Federico Bonazzoli for the winner as Claudio Ranieri's side won a third consecutive match for the first time this season.
Ranieri, who memorably guided outsiders Leicester City to the 2016 English Premier League title, took over last October with the club sitting bottom of the table.
But they have come back strong after the coronavirus lockdown, winning five of their last six games and are 12 points above the drop zone with four games left.
Parma were two goals ahead at half-time thanks to Gervinho and an own goal from Samp goalkeeper Bartosz Bereszynski.
But Julian Chabot pulled one back with his head two minutes after the break before Fabio Quagliarella curled in his 11th of the season with 21 minutes and teed up Federico Bonazzoli for the winner with 12 minutes to go.
Sampdoria move ahead of Parma into 12th position as Roberto D'Aversa's side, who had been targeting the Europa League places earlier this season, slump to their sixth defeat in seven games.
Italian forward Matteo Politano (L) scored a later winner for Napoli.
Claudio Ranieri looks to have secured Serie A survival for Sampdoria after a 3-2 win at Parma