Sassuolo had frustrated the Bianconeri in the first half but their combative approach saw Pedro Obiang sent off moments before half-time.
Danilo put Juve ahead five minutes into the second half with a powerful long-range strike, yet Sassuolo equalised with a fine finish from Gregoire Defrel.
Sassuolo looked on course to take a point but late goals from Ramsey and Ronaldo secured the victory for Andrea Pirlo’s side.A slick Juve passing move opened up the Sassuolo defence early on but Gianluca Frabotta could only shoot wide following a clever back-heel from Weston McKennie.
McKennie picked up an injury in the 19th minute and was replaced by Ramsey, while Ronaldo thumped the ground in frustration moments later when a strong challenge from Vlad Chiriches went unpunished. Sassuolo seemed content to sit back and try to hit Juve on the counter-attack, with Francesco Caputo’s speculative long-range effort the best they could muster early on.
Juve were dealt another blow before the interval as Paulo Dybala limped out with a knee injury before Obiang was dismissed for a lunge on Federico Chiesa following a VAR review.
Merih Demiral nudged the ball past Andrea Consigli in the Sassuolo goal in injury time at the end of the first half, but Ronaldo was unable to reach it in time to finish at the back post. Pirlo’s home team made the extra man count after the interval when right-back Danilo arrowed a low shot from around 25 yards into the bottom left corner of the net.
However, Sassuolo quickly hit back when Defrel latched on to Hamed Junior Traore’s pass, deftly beat two Juve defenders and clipped the ball beyond Wojciech Szczesny.
Ramsey put Juve ahead again when he slid in at the back post to tap in Frabotta’s low cross from the left with eight minutes remaining.
Ronaldo then put the gloss on the result in injury time with his 15th Serie A goal of the season after he latched on to Danilo’s long ball and burst forward before coolly slotting past Consigli.
Ronaldo scored his first Serie A goals when his double helped Juventus beat Sassuolo 2-1 in September 2018 and he has now scored five goals against them in five meetings in the competition.
Even though Juve were below their best, the Portugal forward never stopped trying – his six attempted shots being more than any other player achieved – and he deserved his goal.