Since Milan's triumph under Carlo Ancelotti in Athens 17 years ago Madrid have won the Champions League six times, three of those victories coming with Ancelotti in the dugout.
Antonio Conte's resurgent side wrapped the match up inside the first half, courtesy of an early Romelu Lukaku goal and a sensational strike by Khvicha Kvaratskhelia.
Defender Gabbia rose highest to thump home Tijjani Reijnders' free-kick in the 89th minute and give Milan a Serie A win which pulls them out of a miserable early season slump.
Inter and AC Milan on Friday rejected the project to modernise and restructure the iconic San Siro stadium which they share, city mayor Giuseppe Sala announced.
"Winning is hard but staying up there is even harder. We had to bounce back after drawing at Genoa and we managed to do that," said Darmian to Sky Sport.
Pioli left Milan after the 19-time Italian champions finished second last season, 19 points behind champions Inter Milan, and following lacklustre runs in the Champions League and the domestic cups.
The 37-year-old Giroud leaves as a big fan favourite and will be remembered in particular for scoring key goals in Milan's 2022 Serie A triumph, the only trophy he won in his three years in Italy.
The Milan board paid a warm tribute in the farewell statement to 58-year-old Italian Pioli.
Olivier Giroud confirmed on Monday that he will leave AC Milan at the end of the season to end his long career in Major League Soccer.
The 37-year-old Giroud was in the perfect position to head in their second goal before his brilliant back-heel flick set up Theo Hernandez for the third.
Atalanta set up an Italian Cup semi-final with Fiorentina after winning 2-1 at AC Milan on Wednesday, while Lazio won 1-0 in a fiery derby with Roma which finished with three red cards.
AC Milan consolidated their place in Serie A's Champions League positions on Sunday with a straightforward 3-0 win over lowly Empoli.
Atalanta beat Sassuolo 3-1 on Wednesday to qualify for the Italian Cup quarter-finals where they will meet AC Milan.
AC Milan starlet Francesco Camarda made history on Saturday after becoming the youngest ever player to play in Serie A during Saturday's 1-0 win over Fiorentina.
Mazzarri's team are still seven points behind leaders Inter Milan who travel to Turin on Sunday for the weekend's big match at second-placed Juventus
Gianluigi Donnarumma will be given a fierce reception on Tuesday when he faces crisis-club AC Milan at the San Siro for the first time since jumping ship for Paris Saint-Germain and becoming public enemy number one.
AC Milan are in a difficult group that includes Borussia Dortmund and Newcastle United.
Paris Saint-Germain's Champions League clash with AC Milan this week will see the French club come up against one of the many outstanding talents they have let slip away in recent years.
Khvicha Kvaratskhelia helped put Napoli's Serie A title defence back on track with a brace in Saturday's 3-1 win at Verona which moved the champions four points behind leaders AC Milan.