The 101st-ranked underdog recovered to win 4-6 7-6 (7-2) 6-4 and book a clash with Australian seventh seed Nick Kyrgios or Serb Filip Krajinovic.
Lopez seemed to be be motoring towards a straight-sets victory but the wheels came off and Haase saved two match points in the 12th game of the second set to mount a fightback.
The 101st-ranked Haase took the third set to a tiebreaker and Lopez’s previous superiority disappeared.
He was unable to regain the initiative and has now lost to the Dutchman in all three of their ATP meetings on clay.
Lopez said: “Tennis can be very sad sometimes. There will be days when you do all the right things and you lose anyway.
“Serving twice for the match, it’s not normal to lose like this. I should have closed it out, especially since I had a couple of match points.
“I played great for two sets, I was aggressive and charging the net. Unfortunately, that was not enough today.??The match was close and I just couldn’t find a way to win in the end.”
Meanwhile, French fifth seed Richard Gasquet continued his comeback with a 6-2 6-3 defeat of compatriot Kenny de Schepper.
The 28-year-old had been enjoying a successful season prior to his injury, winning his 11th career title in Montpellier and reaching the last eight in both Doha and Dubai, and he will now face Spain’s Nicolas Almagro, who caused an upset by beating Argentine Leonardo Mayer, in the next round.