The former Cagliari frontman came off the bench to score two late second half goals, with another substitute Mirko
Vucinic adding a third. A Mauricio Pinilla penalty had put Cagliari in front, before Davide Astori's dismissal turned the game on its head.
The game was played at Parma's Ennio Tardini stadium, due to ongoing safety fears at Cagliari's IS Arenas ground.
Cagliari captain Daniele Conti missed out through suspension. For the Bianconeri, Martin Caceres came in for the injured Giorgio Chiellini. It's been confirmed that the Juventus defender will miss three months with the calf injury he sustained in training this week.
The Sardinians were gifted a big chance on 16 minutes. Marco Sau cleverly ran in between Arturo Vidal and Caceres, drawing a foul from Vidal in the area. The referee rightly pointed to the spot for the blatant leg trip. Pinilla smashed the spot kick into the roof of the net and over the top of the diving Gianluigi Buffon.
Andrea Barzagli picked out Stephan Lichtsteiner in the box on 24 minutes, but the Swiss wingback shot wide. On the half hour, Quagliarella flicked on an Andrea Pirlo set piece for Sebastian Giovinco to fire into the skies. More route one Football from Barzagli found Quagliarella in the box, but the frontman blazed a half volley over.
Michael Agazzi punched clear an Andre Pirlo inswinger, then Quaglierella swept a chance wide, despite being hooked around the neck by Astori. Nothing claimed, nothing given.
Pirlo found space just before half time, but his shot was straight down Agazzi's throat and easily gathered.
Pinilla competed with Buffon for a high ball at the start of the second half, with the veteran ‘keeper coming out on top. At the other end, Astori cut out a dangerous Lichtsteiner cross to stop it from reaching Quagliarella. Claudio Marchisio's half volley from the edge of the area weaved past a sea of bodies and into Agazzi's arms.
Nicola Murru was riding a disciplinary tightrope after being booked in the first half. Juventus drew two fouls out of the young defender and Ivo Pulga wisely substituted him for his own good. A quick snapshot from Sau nearly caught Buffon unaware on the hour mark.
Juventus had a goal disallowed three minutes later. Leonardo Bonucci headed a corner onto the bar, Agazzi pulled off a superb point blank save to stop a Matri bicycle kick, and Asamoah headed the ball in, but was adjudged offside.
The game turned when Astori was given a second yellow on 65 minutes for a foul on Giovinco. Juventus duly applied the pressure. Simone Padoin volleyed a grass cutter wide after Vidal did well to hook the ball back from the byline.
Juventus were awarded a penalty on 72 minutes after Giovinco went down under Dario Del Fabro's challenge. It was a soft decision, and justice was done as Vidal ballooned the spot kick over.
With fifteen minutes left, Juventus finally got their equaliser. Vucinic stung Agazzi's palms with his first touch of the ball and Matri was the proverbial fox in the box to pounce on the rebound and tap in.
Matri had the bit between his teeth and forced Agazzi down low to tip a ferocious shot wide. Juventus continued to pour forward as Vucinic wasted a couple of chances.
With a minute to play, Agazzi made a contender for save of the season. He turned a point blank Asamoah header onto the post and instinctively flicked the ball clear with his boot.
Matri then turned in the box, but comically missed the ball and was sent spinning. Six minutes of injury time were added.
In the 92nd minute, Matri broke Cagliari's hearts. A clearance ricocheted off of Vidal's hand and fell kindly to Matri who slotted home.
Juventus rubbed salt in the wounds with a third goal. Giovinco burst clear, Agazzi closed the angle and Vucinic helped the ball over the line with a simple tap in.
Juventus: Buffon; Bonucci, Barzagli, Caceres; (Padoin 62) Lichtsteiner, (Vucinic 72) Vidal, Pirlo, Marchisio, Asamoah; Quagliarella, (Matri 61) Giovinco
Cagliari: Agazzi; Pisano, Astori, Ariaudo, Murru; (Perico 53) Dessena, Nainggolan, Ekdal; Thiago Ribeiro; Pinilla, (Nene 78) Sau (Del Fabro 67)
Goals: Pinilla pen 16 (C) Matri 75, 92 (J) Vucinic 95 (J)
Sent off: Astori 65 (C)