Blaise Matuidi added a third on the hour mark after a goalkeeping clanger from Real's Keylor Navas.
The Italian giants overturned a three-goal deficit at the Bernabeu, and the match was heading for extra time before Lucas Vazquez was bundled over in the box.
The Second goal came For Juve when Lichtsteiner curled over a cross from the right and Mandzukic leapt above Carvajal at the far post and nodded into the net from six yards!
Ronaldo then stepped up and duly slotted the penalty past substitute goalkeeper Wojciech Szczesny with his team moving into the semi-finals 4-3 on aggregate.
The penalty came as Vazquez was in position to score in front of the goal after Ronaldo headed down a cross into the area.
Gianluigi Buffon was so incensed by the decision he charged from his goal line to remonstrate with the English match official, and was seen shouting in his face.
Juventus were left with what Gazzetta dello Sport described as a mixture of pride and anger after their extraordinary Champions League comeback against Real Madrid was thwarted by a contentious injury-time penalty. Vincenzo Montella's side had their chances in the first half with Joaquin Correa and Sergio Escudero both failing to convert.
In Germany, Bayern Munich were held to a goaless draw by Sevilla but Bayern go through 2-1 on aggregate following last Tuesday's victory in Spain.
However, it all ended in frustration for the Spanish side, who lost Correa late on to a straight red card, as Bayern held on to book their place alongside Real Madrid, Liverpool and Roma in Friday's semi-final draw.