The hosts came even closer when Nikola Kalinic latched on to Ilicic's pass and found himself through on goal, but he fired his low effort straight at Lopez.
Milan were struggling to deal with the pace of their opponents' attack and in the 36th minute they were reduced to 10 men when Rodrigo Ely bundled over Kalinic and picked up his second booking of the match.
Fiorentina made Milan pay immediately as, from the resulting free kick, Alonso bent an effort beyond the reach of Lopez and into the top corner.
Within 10 minutes of the second half the hosts were awarded a penalty after Alessio Romagnoli brought down Ilicic inside the box, and the Slovenian converted the resulting spot kick to double his side's lead.
The Rossoneri tried to pull a goal back, and Bacca saw a header well blocked, but they were unable to find the net, as Sinisa Mihajlovic's first game in charge of the club ended in disappointment.