Genoa looked set to earn a hard-fought point in Thiago Motta's second game in charge after Christian Kouame's freak goal had cancelled out Leonardo Bonucci's 36th-minute header.
Both sides had a men sent off in the second half, Genoa's Francesco Cassata and Juve's Adrien Rabiot given their marching orders, before Ronaldo took centre stage.
The Portuguese first had a 92nd-minute tap in ruled out by VAR for offside. But that was far from the end of the drama, and there was still time for Ronaldo to fire a sluggish Juve to victory, as the striker himself won the decisive penalty following a coming-together with substitute Antonio Sanabria - VAR this time going in his favour after the spot-kick was checked by the officials.
Juve coach Maurizio Sarri had said in the build-up that his side were suffering a "mental issue" in front of goal and they barely threatened in a tame first 30 minutes against a team with the worst defensive record in the league.
A stunning save from Ionut Radu eventually denied Paulo Dybala the opener and that chance finally woke Juventus up from their slumber, as Bonucci soon broke the deadlock.
The defender was aided by Radu's decision to come off his line in an attempt to collect Rodrigo Bentancur's corner, the goalkeeper beaten to the ball by Bonucci, who simply nodded into an empty net.
Parity was restored within five minutes, though, thanks to Kouame's slice of accidental glory.
Aiming at goal with his right foot, the Ivorian managed to kick the ball into his trailing leg, the deflection subsequently wrong-footing Juventus goalkeeper Gianluigi Buffon in his 513rd league appearance for the Italian giants, which saw him equal Alessandro del Piero's club record.
Juve ramped up the pressure after Cassata's 52nd-minute dismissal - for a second yellow card - and Federico Bernardeschi then forced an excellent save from Radu with an effort from distance, before Ronaldo tested the shot-stopper from a corner.
Home substitute Douglas Costa fizzed a long-range effort agonisingly wide before Rabiot was given his marching orders - a foul on Sinan Gumus earning him a second yellow - but the hosts still found a way in the dying stages to claim the points, thanks to a spell of VAR-heavy drama.
Initially, Ronaldo scored and celebrated before his goal was disallowed for offside, but then a debatable penalty followed and the Portuguese star stepped up to thump it home and send Juventus back to the top of the Serie A table.
What it means
Juventus remain the only unbeaten side in Serie A and victory takes them back to the top of the table, one point ahead of Inter. Genoa are just one point above the bottom three in 17th.
Dybala's star turn
Juventus were far from their fluent best, meaning Dybala really stood out in an excellent performance.
The Argentina star struck fear into Genoa every time he got the ball, his creativity and ability on the ball particularly eye-catching.
Cassata pays the price
Genoa's game plan when Dybala got the ball was obvious: foul him.
Cassata brought Dybala down twice in the first three minutes and was booked for the second, leaving him walking a tightrope for the remainder of the contest.
And the 22-year-old could not help himself, given a second yellow card in the 51st minute for pulling back ... Dybala.
Key Opta stats
- Ronaldo's last injury time goal prior to this, for any club, came for Real Madrid against Juventus (April 2018, via a penalty).
- Juventus fired 12 shots on target in a Serie A match for the first time since May 2018, against Verona.
- Bonucci is the only defender to have scored at least one goal in all of the last seven Serie A campaigns. His last six strikes have all come from corners.
- Buffon equalled Del Piero (513) as the player with the most league appearances for Juventus, including Serie B appearances.
Juventus visit Torino for a much-anticipated derby on Saturday, while Genoa go in search of successive Serie A home wins for the first time since September last year.