Ronaldo sat out the 1-1 draw at Lecce over the weekend but Juve looked set to drop more points on his return in Turin as Christian Kouame's fluke equaliser cancelled out a header from Leonardo Bonucci.
The Portuguese forward saw a stoppage-time strike ruled out by VAR for offside before he won a last-gasp penalty after he was fouled by Toni Sanabria.
Ronaldo drilled the spot-kick low beyond Ionut Radu for his fifth league goal of the season to send Maurizio Sarri's Juve back above Inter Milan at the summit.
Genoa, in their second game under Motta, played most of the second half with 10 men after Francesco Cassata was sent off, while Juve substitute Adrien Rabiot was dismissed late on for two bookable offences.
Roma climbed above Napoli into fourth after a 4-0 rout of Udinese despite losing Federico Fazio to a red card on 31 minutes.
Nicolo Zaniolo opened the scoring before the dismissal of Fazio for a foul as the last defender.
Chris Smalling doubled Roma's lead early in the second half with a Justin Kluivert goal and Aleksandar Kolarov penalty wrapping up victory.
Ciro Immobile struck twice to take his league-leading tally to 12 goals as Lazio swept Torino aside 4-0.
Cagliari extended their unbeaten run to eight games with a 3-2 win over Bologna while Fiorentina came from behind to defeat Sassuolo 2-1.
Sampdoria remain rooted to the foot of the table despite Gaston Ramirez salvaging a 1-1 draw with an injury-time equaliser at home to Lecce.