Nadal came from a mini-break down in the tiebreaker and secured victory on his second match point.
“It was a good match, a very positive victory for me over a tough opponent,” Nadal said.
“I’m happy to see Stan playing well again. We had a good quality of tennis.
“I’m very pleased, I needed a match like this. It does much for the confidence.”
Nadal’s win was his 17th from 20 played against Wawrinka.
Second seed Alexander Zverev, the holder, lined up a re-run of last week’s Washington semi-final as he again takes on Stefanos Tsitsipas.
The Greek who turns 20 on Sunday knocked out his second seed in as many matches, stunning Wimbledon champion Novak Djokovic 6-3, 6-7 (5/7), 6-3 to reach the quarter-finals.
Zverev rolled over Russian Daniil Medvedev 6-3, 6-2 in 52 minutes while never facing a break point.
Tsitsipas called his knockout of Djokovic, “the best match of my career. I knew I was playing pretty good today.”
The number 27 will play the first Masters 1000 quarter-final of his career.
“He played very well and deserved to win without a doubt,” Djokovic said. “I just played not that great.
“I didn’t return well. It wasn’t that great of a match.”
Bulgarian fifth seed Grigor Dimitrov laboured for almost two and a half hours to subdue Frances Tiafoe of the United States 7-6 (7/1), 3-6, 7-6 (7/4).
He next faces Wimbledon runner-up and fourth seed Kevin Anderson who defeated Ilya Ivashka of Belarus 7-5, 6-3 to also make the last-eight.
Sixth seed Marin Cilic continued his quiet progress, beating Argentine 11th seed Diego Schwartzman 6-3, 6-2.
Canadian teen Denis Shapovalov went down to Robin Haase, losing 7-5, 6-2, ending local interest. The Dutch winner will take on Karen Khachanov, who beat eighth seed John Isner 7-6 (7/5), 7-6 (7/1).