The eighth seed thundered down 30 aces as he made the last eight with a 6-4 4-6 6-3 6-7 (7-9) 6-3 win over 12th-seeded Lopez just over three hours of action on Hisense Arena.
Victory helped the big-servingRaonic become the first Canadian man since Michael Belkin in 1968 to win through to the last eight.
He also equalled countryman Robert Powell's feat of playing in three Grand Slam quarter-finals set back at the 1908, 1910 and 1912 Wimbledons.
The 24-year-old, who reached the semi-finals at last year's Wimbledon, squandered two match points when he was serving for victory in the fourth set.
Lopez took it to a fifth set, but Raonic regained his composure broke the left-handed Spaniard in the eighth game and then blasted three straight aces on the way to serving it out in the following game.
"It's great to be here in the second week, there was some great tennis played today and I just think that is only going to get better," Raonic said.
Raonic hit an extraordinary 81 winners and first served at 75 per cent, winning 79 per cent. His monster serve was only broken once by Lopez.
Next up will be a quarter-final against either world No 1 and four-time champion Novak Djokovic or Luxembourg's Gilles Muller on Wednesday.