In a goal-laden first half, Sandro Tonali broke the deadlock after 12 minutes, curling a sublime free kick into the net to give Milan the lead, before Alessandro Deiola headed the visitors level three minutes later.
Parity was restored for less than two minutes as Rafael Leao edged Milan back in front before Giroud scored his first goal for his new club after joining them from English Premier League side Chelsea in the close season.
The first-half scoring was not done there as Giroud converted from the penalty spot just before the interval to make it 4-1.
Pioli's side cruised to their second successive win, finishing the weekend as one of five teams on six points.
Napoli also have maximum points after their 2-1 win at Genoa on Sunday, with substitute Andrea Petagna striking six minutes from time to secure the win.
The night was all about Giroud, as he stepped up in the absence of last season's top goalscorer Zlatan Ibrahimovic to inspire his side to victory.
'I am very proud to play for Milan, playing at San Siro is a great emotion,' he told DAZN.
'There is something special about being Milan's number nine. I grew up watching (Jean-Pierre) Papin, (Marco) Van Basten and Filippo Inzaghi.'
Serie A leaders Lazio beat Spezia 6-1 on Saturday, Italy striker Ciro Immobile netted a hat-trick during the rout.
Inter Milan made it two wins from two after they beat Verona 3-1 on Friday, Joaquin Correa scored in the 94th minutes to seal all three points for Simone Inzaghi's side.
Roma also have maximum points from their two games after a 4-0 win over Salernitana on Sunday, Lorenzo Pellegrini scored twice during the rout.
Napoli also have a 100% record after beating Genoa 2-1 on Sunday, Andrea Petagna scored a late winner Stadio Luigi Ferraris.