Leao also played a crucial role in Ruben Loftus-Cheek's second-half goal, while Noah Okafor scored twice in the late stages to seal Milan's victory.
Liverpool's Dominik Szoboszlai and Cody Gakpo found the back of the net, but AC Milan's performance was the stronger on the night.
AC Milan manager Max Allegri gave new signing Pervis Estupinan his debut, while Liverpool's Arne Slot started with Rio Ngumoha on the flank and Florian Wirtz featured in the match.