Nadal held serve to win his first game of the match to start the second set and dug deep in a grueling back-and-forth classic to advance to the semifinals, 0-6, 6-4, 7-5, 6-7, 7-6.
Nadal was completely dismantled by Thiem in the first set as the American crowd was shocked into silence in NY, the Austrian hitting vaporising forehands and backhands to wrap up the opener in just 24 minutes - tallying 13 winners, five aces and 24 points in total compared to just seven from the former.
It was the fourth win for Nadal in four Grand Slam matches against Thiem, the most recent coming in May's French Open Final.
Thiem was also 5-3 ahead in the third set and 4-2 in the fourth before he was reeled in by Nadal, the three-time champion in NY.
Nadal will face Juan Martin del Potro in the semi-final of the US Open.
Meanwhile, Serena Williams survived her first test of the tournament to reach the quarter-finals for the 15th time.
"I'm sad for him because when this moment arrived, he did all the things well to win the match".
When it ended, on an overhead by Thiem that sailed long, everyone in Nadal's guest box - a group that included actor Ben Stiller - leaped to their feet to celebrate.
Dubai Flight Quarantined At JFK After Reports Of Sick Passengers
'All we have been told is that there are some sick passengers and that we need to remain on board, ' he said . Emirates Flight 203 from Dubai was headed to NY when at least 100 of its 500 passengers reported feeling ill.
Thiem dominated on serve, winning 91 percent of his first-serve points (41/45) and never faced a break point. I could go very far back like I do on clay usually.
Both players suffered in the humid conditions under the floodlights at Arthur Ashe Stadium, but Del Potro fed off the energy of the crowd, including a group of his friends who have traveled from his hometown Tandil to cheer him on.
If anybody still had any doubts over the Roland Garros runner-up's prowess on other surfaces, then he quashed them in style by winning a fourth set tie-break and setting up a deciding fifth set.
"I don't think he's really sorry", said Thiem with a smile.
"Still long way to go, I think", she said.
Anderson admitted the better man beat him on the day‚ after having his serve broken three times in the match. After that first set, then the match became more normal.
"I told myself "wake up", said Nadal.
But in the third set Basilashvili, who is ranked 37 and enjoying his best season, found the right balance, not going for broke too early and instead building the point and using the angles with his excellent two-handed backhand. Thiem certainly has the game to trouble the number one seed, as proven by his three career victories, and he is well capable of hitting the lines with regularity which will be the key to success for the Austrian.