Juve made a slow start in Sardinia and fell behind when Italy striker Joao Pedro stroked the hosts into a 10th-minute lead.
The visitors dominated the remainder of the opening period and got themselves back on level terms on the stroke of halftime when Dutch defender Matthijs de Ligt headed home.
There was only going to be one winner as Juve remained well on top in the second half, with the pressure finally telling as January signing Vlahovic scored his fifth league goal since arriving in Turin to seal victory for his new side.
The win helped fourth-placed Juve close to within four points of Napoli in third, ahead of the Neapolitans' clash with Fiorentina on Sunday.
At the other end of the standings, Cagliari's fifth successive league loss left them three points above the relegation zone, having played two more games than Venezia in 18th.
An unbeaten league run stretching back to November before last weekend's clash with Inter had dragged Juve back into the title race, but the defeat by the champions, coach Massimiliano Allegri has insisted, meant the Scudetto was out of reach.
The title would have felt even further away after Joao Pedro's fine finish from the edge of the penalty area – his 12th league goal of the season.
Juve thought they had come up with an immediate response after Luca Pellegrini's shot found the net, via a deflection off Adrien Rabiot, but it was ruled out following a VAR review with Rabiot adjudged to have used his arm to divert the ball home.
Further chances came and went as it looked Juve would be frustrated going into the break, before De Ligt guided Juan Cuadrado's cross into the net.
Argentine striker Paulo Dybala, who is leaving the club at the end of the season, wasted a golden chance to complete the comeback early in the second half, firing over from a good position.
Cuadrado drilled wide as that game-killing second continued to elude Juventus, before Vlahovic poked home from close range to break Cagliari's resistance and get Juve back to winning ways.