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.