The deal also includes a number of performance-related clauses worth a maximum of 8 million euros.
AC Milan has a lot more to do despite winning the last round Serie A title against Atalanta.
The victory puts Atalanta at third place, level on 66 points with Inter Milan, but ahead on head-to-head record.
The victory also earns Lazio a place in the Europa League group stage for next season.
Atalanta moved into fourth place with 59 points, one ahead of AS Roma with four games left.
Federico Chiesa scores a stunning solo goal and sets up the late equaliser for Luis Muriel after Atalanta, who knocked out title holders Juventus in the previous round.
Atalanta pull off another surprise result, ensuring Juve will not win the competition for a 5th season running.
Atalanta, now 6th equal on points with Roma and Sassuolo, move 1 point behind Lazio, in 5th, but without a win in their last 5 league games.
Napoli, held 0-0 at home by bottom club Chievo in their previous game, took a second-minute lead when Fabian Ruiz turned in Lorenzo Insigne's cross.
Inter Milan's seven-game winning streak in Serie A came to an end when they lost 4-1 to Atalanta.
Gian Piero Ventura's return to coaching ended in a 5-1 loss for his Chievo team against Atalanta, partially due to a Josip Iličić hattrick.
Fiorentina coach Stefano Pioli and his Atalanta counterpart Gian Piero Gasperini clashed after the final whistle over a hotly-disputed penalty which set up a 2-0 win for Fiorentina.
Javier Pastore's goal was not enough to lead Roma to victory against Atalanta.
Alejandro 'Papu' Gómez's two goals helped Atalanta beat Frosinone 4-0.