The Spanish fourth seed came through 6-4 3-6 7-6 (7-3) to set up a quarter-final against Russian eighth seed Svetlana Kuznetsova, who beat Spain's Carla Suarez Navarro 6-2 6-4.
The Dane could next meet world number one Karolina Pliskova, who was leading Italian qualifier Camila Giorgi 3-0 when play was suspended.
No. 2-seeded Simona Halep led the seeded charge, defeating No. 15 Anastasija Sevastova 6-4, 6-3.
With the victory the Romanian avenges her loss to Johanna Konta in the Wimbledon quarterfinals-but she had to work through some demons to do it.
"I'm not playing my best tennis, but winning when I'm not playing good is a plus for me", Halep said. When Halep reached double match point serving at 5-3, it appeared that the second seed was headed for a surprisingly swift victory.
"I obviously had some unforced errors that I wasn't happy about, but I felt like I had to go for it because she was just going to make everything", Keys said.
The 28-year-old Japanese captured his first ATP World Tour title at the Antalya Open in July, adding to three ATP Challenger Tour events won in 2017. And she is relishing the prospect of facing second seed, Halep, having already defeated the Romanian twice this year, in the quarter-finals at Miami and Wimbledon respectively.
Konta took the first set with two breaks of serve to one and looked to have the match well under control when she broke at the start of the second set.
Sixth seed Caroline Wozniacki saw off Australian qualifier Ashleigh Barty 6-4 6-2. I think both of us compete very well. "It gives me a little bit more power, inside, that I can handle it". The seventh-seeded Dimitrov got his first career win in six matches against Del Potro.
Bulgarian Dimitrov eased past Japan's Yuichi Sugita 6-2 6-1, while Isner overcame fellow American Jared Donaldson 7-6 (7-4) 7-5.
David Ferrer reached his first ATP Masters quarterfinal in his last 11 tries with a 6-4, 6-4 win over Pablo Carreno Busta.