Fiorentina, outclassed by Sevilla in Europe's second tier competition last week, got off the mark in Sicily thanks to former Palermo forward Josip Ilicic's 23rd minute screamer from 25 metres.
Mato Jajalo levelled for the hosts with a great volley only three minutes later, but Fiorentina were back in front just after the half hour when Alberto Gilardino was on hand to turn a Mati Fernandez shot past Stefano Sorrentino.
Vincenzo Montella's visitors were stunned on 69 minutes when Luca Rigoni levelled for the hosts, but Marcos Alonso restored their lead 12 minutes from time to ruin what was Palermo striker Paulo Dybala's last home game before his imminent move to Juventus.
The result moved Fiorentina up one place to fifth, two points ahead of sixth-placed Genoa.
Genoa hold the third and final Europa League spot but have been excluded from European competition because their Luigi Ferraris stadium does not meet UEFA standards.
Fiorentina's six-point lead over Sampdoria, in seventh, means their spot in next season's Europa League is secure.
Elsewhere, a brace of goals, including one from the spot, from Toni in a 2-2 draw away to Parma saw the evergreen Verona striker leapfrog Carlos Tevez and Inter Milan striker Mauro Icardi to lead the Serie A scoring charts.
With one game remaining, Toni now leads Juventus striker Tevez and Icardi, who both have 20 goals, by one.
With Juventus securing the double thanks to Wednesday's Cup final win over Lazio, the battle for European places continues apace.
Lazio host Roma on Monday looking for the win that would allow them to leapfrog their city rivals into second place ahead of next week's final round of games.
A second place finish secures automatic entry to the Champions League, while the team that finishes third goes into a play-off round.
Roma were held 2-2 by Lazio earlier this season, but coach Rudi Garcia said a third place finish is not in his plans.
"We want to make sure that tomorrow's game is the only one that matters for us in this campaign," Garcia said in his pre-match conference Sunday.
"It's up to us tomorrow to show that we are the stronger of the sides."
Although Napoli, in fourth at three points behind Lazio, remain in Champions League contention, the Biancocelesti require only a draw on Monday to make sure of at least a third place finish.
It has left Rafael Benitez's men, beaten 3-1 by a second-string Juventus on Saturday, heading towards the Europa League alongside Fiorentina and a third side that is increasingly looking like Sampdoria.
A last-gasp leveller from Samuel Eto'o kept Sampdoria's Europa hopes alive but Sinisa Mihajlovic's men will be relying on results elsewhere.
Sampdoria share Genoa's Luigi Ferraris stadium but have already lodged Sassuolo's Mapei stadium as the venue for European home games in the event they qualify for Europe.
Mihajlovic, however, was less than happy with a scenario which means his side must beat Parma in their final game of the season and hope results elsewhere go their way.
"We've claimed a point, now we need to win our last game and see what happens elsewhere," Mihajlovic told Sky Sport.
"Genoa are ahead of us and I take my hat off to them...but it would only be a small consolation for us if we got into the Europa League because of their misfortune."
In Sunday's late game Stephan El Shaarawy hit a brace and Giampaolo Pazzini, from the spot, scored his 100th Serie A goal as ten-man AC Milan put three unanswered goals past ten-man Torino.
The win was one that boosted only Milan's pride amid a disastrous season that has seen the seven-time European champions miss out on Europe altogether.