Serbia forward Vlahovic headed in Alvaro Morata's overhead kick from practically on the goalline to save some face after in-form Marko Arnautovic had put Bologna in the lead seven minutes after the break with his 12th goal of the season.
A beautiful spring evening in Turin had begun with the return of club icon Alessandro Del Piero, who made his first official appearance at the Allianz Stadium since leaving the club against his will in 2012 and was given a standing ovation from fans.
However Juve were uninspired despite the presence of the World Cup winner and Vlahovic's leveller in the fifth minute of stoppage time couldn't mask a poor display which left them eight points behind league leaders AC Milan with five matches remaining after the Easter weekend.
"Earlier in the season we would have lost this match, so let's look at it as a glass that's half-full," said Juve coach Massimiliano Allegri, who didn't comment on the bizarre sequence of events on which the match turned.
Adama Soumaoro was sent off six minutes from the end for his desperate attempt to stop Morata from equalising, which after a VAR check -- and Juan Cuadrado hitting the post in front of an open goal -- was ruled to have happened outside the area.
In the confusion, Gary Medel became so livid with referee Juan Luca Sacchi that he was booked twice within seconds and also off the field, while Juve were baffled at how the VAR officials could have ruled Soumaoro's challenge outside the area.
Bologna thought they had held out in a bizarre end to a match but Vlahovic struck for fourth-placed Juve, who are now looking over their shoulders at contenders for the final Champions League spot.
Roma can close to within three points of Allegri's side with a win at title-chasing Napoli on Monday while Fiorentina are a point behind Jose Mourinho's team with a game in hand after beating Venezia 1-0.
Lazio are level with Fiorentina in seventh after Ciro Immobile snatched a 1-1 draw against Torino in stoppage time with his 25th league goal of the campaign.
"We need to be more clear-headed," added Allegri.
"We were missing that after we equalised because even though there were only a few minutes left there was still enough time to win the game."
Dreaming of survival
Franck Ribery believes that Salernitana can perform a miracle escape from relegation after a 2-1 win at fellow strugglers Sampdoria kept alive their hopes of staying up.
Goals from Federico Fazio and Ederson in the first six minutes in Genoa were enough to take Salernitana to 19 points and continue the southern team's bid for safety after an entire season at the bottom of the league.
With two games in hand, Salernitana are nine points behind Cagliari who sit six points and one place outside the relegation zone following their 1-0 win over Sassuolo earlier on Saturday.
"Today we showed that we're working hard and we believe in survival... Let's see what happens," former France winger Ribery told DAZN after playing 25 minutes as a substitute at the Stadio Luigi Ferraris.
A first win since early January puts Davide Nicola's team three points behind both Genoa, who lost 2-0 to league leaders AC Milan on Friday, and Venezia.
"We want to stay in Serie A but it's been difficult. We've played matches which we've lost in which we deserved more and that's not easy," added 39-year-old Ribery.
"When I'm on the pitch, I'm happy, I have fun. Football, for me, is a passion."
Sampdoria were loudly whistled off the field by irate fans. The club have been dragged right back into the relegation battle and are a point above Cagliari.
Udinese continued their impressive end to the season by thumping Empoli 4-1 to move 12th.