Three goals in the first 49 minutes by Hernanes, Antonio Candreva and Miroslav Klose had the home side coasting, but Nigel De Jong and Stephan El Shaarawy ensured there was a tense finale to this pulsating matchup inside the Stadio Olimpico.
Milan have now lost five of their opening eight Serie A games and lie perilously close to the relegation zone. With the Rossoneri now a massive 15 points behind league leaders Juventus, surely their title chase is over. Lazio, however, remain in the mix.
Ederson and Stefan Radu missed out for Lazio, and lost Federico Marchetti to a muscular injury during the warm-up, so Albano Bizzarri took the gloves. Mauro Zarate was back on the bench after being frozen out against Pescara. Zarate has reportedly hired a personal trainer to get back in Vladimir Petkovic's good books.
De Jong fizzed the first shot wide on seven minutes, as both sides wasted early corners. The home side overloaded the box and an unintentional Kevin Prince-Boateng handball went unpunished.
Nocerino curled wide from the edge of the box, before Lazio scored on 25 minutes, with their first effort on goal.
Hernanes ran through the middle of the park, bamboozling Daniele Bonera and turning the stand-in captain inside out. Bonera deflected the Brazilian's shot from the edge of the area and the ball looped over a rooted Marco Amelia. During the goal celebrations, Petkovic had words to try and calm down Dias.
Less than a minute later, Dias cleared off the line after Stephan El Shaarawy unlocked the Lazio defence and rolled the ball past Bizzarri. Dias threw his fists in the air like he had scored himself. The Brazilian came to the rescue again ten minutes later, cutting out a dangerous Nocerino cross.
Four minutes before the break, Candreva doubled the lead with a trademark wonder strike, which reportedly came straight from the training ground. The recalled Italian international let fly from 25 yards and the ball dipped into the top corner, swerving past a helpless Amelia. Practice certainly made perfect in this instant.
Just before the interval, Giuseppe Biava stuck out a leg to cleanly dispossess Nocerino in the box and Amelia finally got his gloves on the ball when Hernanes shot straight at him from 30 yards.
Klose looked to have sealed the game just four minutes into the second half. The German exposed poor marking from Bonera to volley home a pinpoint Candreva cross from eight yards and register his sixth league strike of the campaign. Before the goal, Klose had barely touched the ball and was taking a battering from the Milan backline.
Substitute Urby Emanuelson spurred the visitors into life, crossing for Pazzini to head wide. Moments later, the same two combined and Bizzarri had to tip a second Pazzini header over the bar. From the resulting corner, another substitute, this time Pato was unmarked, but he headed wide.
Milan reduced the arrears from a dead ball position. Emanuelson rolled the ball across the Lazio box, Pato stuck a leg out and missed, but an unmarked De Jong was in the perfect position to slide home. It was sloppy play from the home defence who had simply switched off.
Lazio awoke from their slumber, but Amelia proved to be equal to a couple of Hernanes efforts. At the other end, some Emanuelson trickery deceived Luis Cavanda and an inviting ball found the head of El Shaarawy, but Bizzarri easily gathered.
El Shaarawy made amends 11 minutes from time, cutting inside the box and firing a low shot into the bottom corner past the outstretched hand of Bizzarri.
Cristian Brocchi made an emotional cameo against his former club after recovering from a career threatening foot injury, while Milan threw on former Roma frontman Bojan Krkic as they rolled the dice one final time.
Allegri was screaming from the touchline as the seconds ticked down and there was relief all around the Olimpico when the final whistle sounded.
Lazio: Bizzarri; Konko, Dias, Biava, Lulic; Ledesma; Candreva, (Brocchi 83) Gonzalez, (Cana 71) Hernanes, Mauri; (Cavanda 57) Klose
Milan: Amelia; Abate, Yepes, Bonera, Antonini; (Bojan 85) De Jong, Montolivo, Nocerino; (Pato 51) Boateng; (Emanuelson 46) El Shaarawy, Pazzini
Goals: Hernanes 25 (L), Candreva 41 (L), Klose 49 (L), De Jong 60 (M), El Shaarawy 79 (M)