Del Piero netted both goals for the Old Lady.
Ranieri said: “Winning 2-0 at the Bernabeu is nothing to be sniffed at. We have returned to our best over the past 15 days and the first leg victory gave us back the self-confidence we had lost.
“I was very happy with my lads as they did what I asked, keeping the defence very high and therefore pressuring Madrid in midfield.
“When you play against a star-studded side that always pushes forward and leaves just one defensive midfielder, then the counter-attack can hurt them. If we just sat back and let them come at us, they would inevitably find a way through, but if we kept hitting them chance for chance then we would get the win.”
Ranieri also praised Tiago Mendes, who impressed on the midfield.
He said: “Tiago is a marvellous player who struggled last season under the pressure of his price-tag and the change of tactics, as he was accustomed to a three-man midfield. He got a bit lost along the way, but he has played three great games in a row and everyone can see he is talented. We’re keeping hold of him.”