Vlahovic, who had been under fire from Fiorentina fans for refusing to sign a contract extension, put the hosts into what looked like a safe three-goal lead an hour into an error-strewn contest at the Stadio Artemio Franchi.
And he saved the home side again with five minutes to go by rolling home the fourth following Zlatan Ibrahimovic's two quick strikes shortly after Vlahovic's first.
Vincenzo Italiano's Fiorentina are up to sixth on 21 points, four away from the Champions League positions, after a win in which Alfred Duncan and Riccardo Saponara also netted for the hosts and Lorenzo Venuti scored an unfortunate stoppage-time own goal.
Milan meanwhile missed the chance to go top and stay level on 32 points with league leaders Napoli, who take on Inter Milan at the San Siro on Sunday.
Milan goalkeeper Ciprian Tatarusanu gifted Fiorentina the lead in the 17th minute, dropping an easy catch from a corner and letting Duncan poke home the opener.
Vlahovic then headed over a good chance before Milan responded with Sandro Tonali and Rafael Leao both having good shots saved and Ibrahimovic somehow heading a gift-wrapped chance wide.
Saponara then punished Milan with a superb curling strike in first-half stoppage time and when Vlahovic danced round Tatarusanu to make it three the match looked done and dusted.
The hosts then immediately proceeded to shoot themselves in the foot, Giacomo Bonaventura rolling the ball to Ibrahimovic in the area and allowing the Swede to fire Milan back in the game in the 62nd minute.
Ibrahimovic then cut the deficit to one with a tap-in from Theo Hernandez's cross, but Vlahovic saved the day with his 10th league goal of the season which puts him level with leading scorer Ciro Immobile.
Standout matches today