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.
- Bonucci sinks Lazio -
Leonardo Bonucci struck twice from the penalty spot in a 2-0 win at Lazio which continued Juventus' climb up the Serie A table following a rocky start to the campaign.
Italy defender Bonucci smashed home almost identical spot-kicks in each half at the Stadio Olimpico in
Rome to move Juve seventh, level on points with Fiorentina and fifth-placed Lazio.
It was a dogged, solid away performance typical of Massimiliano Allegri's best sides and a good sign ahead of Tuesday's trip to Stamford Bridge to face Premier League leaders Chelsea.
"It was a really important win, it's always hard to play matches after the international break but we know that with this approach and spirit of sacrifice that results depend on us," said Bonucci after his first Serie A double.
"When you're Juve and played like we did at the start of the season it's right that you get criticised, but that should encourage us to improve. It's down to us to maintain the same spirit from tonight."
The win for Juve was their first by more than one goal in Serie A this season, and they stay some way off pace-setters Napoli and Milan.
Atalanta's 5-2 demolition of Spezia keeps them fourth, level on 25 points with Inter Milan who sit third.
serie a AC Milan Fiorentina Juventus