The hosts responded soon after with Federico Chiesa curling a free-kick harmlessly over before the visitors threatened again when Dossena headed wide from a corner.
Chances remained limited in a tight first half, but Weston McKennie went close to a superb goal on the cusp of half-time.
McKennie started the move deep inside Juventus’ half and got on the end of Kostic’s cross, although he could only flick off target to ensure it stayed goalless at the break.
Allegri’s men came out with better intent after the interval and Chiesa tested Simone Scuffet inside 60 seconds, but the Cagliari goalkeeper was equal to the effort.
Chiesa was in the mood now and sent an ambitious volley over before he rifled wide after a dangerous cross from Kostic.
Kostic’s delivery was beginning to cause the away side problems and the opener finally arrived on the hour mark.
A free-kick from the wing-back picked out Bremer, who powered a header into the far corner for his first goal of the campaign.
One quickly became two when another Kostic set-piece resulted in Rugani bundling the ball into the net from close range in the 70th-minute.
74’ | GOOOOOOOLLL
Dossena accorcia le distanze! 2-1
— Cagliari Calcio (@CagliariCalcio)
The goal was not without controversy after Rugani first diverted Kostic’s corner onto the crossbar with his hand in close proximity before he was able to chest the loose ball in to make it 2-0.
A VAR check allowed the goal to be given, but Cagliari reduced the deficit with 16 minutes left.
Jakub Jankto’s corner was powered home by Dossena to give Ranieri’s side hope of earning their veteran manager his 700th point in Serie A.
There would be no happy ending for Ranieri at the home of his old club Juventus after Dossena’s late header hit a post and Gaetano Oristanio sent another effort wide.