Two goals by Croatia international Ante Rebic plus strikes by Theo Hernandez and Brahim Diaz helped the Rossoneri to recover from their early shock after Udinese defender Rodrigo Becao put the visitors ahead 90 seconds into the game.
- ESPN+ viewers' guide: LaLiga, Bundesliga, MLS, FA Cup, more
- Don't have ESPN? Get instant access
The Brazilian defender, who nodded in a corner from a tight angle, netted for only the fifth time in Serie A at the start of his third season in Italy. Three of his goals have come against Milan and all three were headers.
Milan equalised in the 11th minute through a penalty from Theo Hernandez, after the referee pointed to the spot following a VAR review when captain Davide Calabria was fouled by Udinese defender Brandon Soppy.
Four minutes later Rebic made it 2-1 with a powerful first-time shot but Udinese defender Adam Masina's diving header stunned the home crowd as the visitors levelled just before half-time.
One minute into the second half midfielder Brahim Diaz yet again put Milan ahead after a fatal mistake by the Udinese defence.
Diaz rifled in the ball from close range after Hernandez sent a cross into the box and it bounced off Masina.
The goal fired up Udinese but Rebic smashed another shot past keeper Marco Silvestri into the top left corner in the 68th minute to restore the hosts' two-goal lead.
Udinese, who finished 12th last season, were the last side to score against Milan at the San Siro before the champions went on a run of five home games without conceding a goal to clinch the title.