Roberto Pereyra and Fernando Llorente were on target for Massimiliano Allegri’s men and Carlos Tevez missed a penalty, while they were twice pegged back with second-half goals from Luca Toni and Juanito.
The visitors finished the match with 10 men after Simone Pepe saw red late on ahead of next weekend’s Champions League final against Barcelona.
Giacomo Bonaventura bagged a brace against his former club Atalanta as AC Milan won 3-1 at the Atleti Azzurri d’Italia.
In what could be Filippo Inzaghi’s last game in charge of Milan it was the hosts who opened the scoring through Daniele Baselli after 21 minutes.
But Giampolo Pazzini and Bonaventura struck back before half-time, with Atalanta academy product Bonaventura adding his second of the evening late on, as Milan ended the Serie A season with back-to-back wins.