The 32-year-old Spaniard led by two sets to love before Basilashvili, ranked 37th in the world, recovered to take a third-set tiebreak, BBC Sport reported.
But the top seed broke twice as Basilashvili faded physically in the fourth to win 6-3, 6-3, 6-7 (6-8), 6-4.
He faces ninth seed Dominic Thiem next.
Nadal has reached at least the quarterfinals in all four Grand Slams this year – the first time he has achieved the feat since 2011.
Austria's Thiem knocked out South African fifth seed Kevin Anderson – the man who lost in the final to Nadal at Flushing Meadows last year – in three sets earlier on Sunday.
For Thiem, Tuesday's quarterfinal offers a chance to avenge a defeat by Nadal in his first Grand Slam final at June's French Open.
Nadal had to dig deep to beat powerful Russian Karen Khachanov in the third round, fighting back from a set and a break down – also overcoming a slight knee injury – to win one of the most thrilling matches of this year's tournament so far.
Two days later Nadal, who played without any strapping on his right knee, needed another three hours 19 minutes to overcome Basilashvili.
"I've had tough matches in a row," said Nadal, who is chasing an 18th Grand Slam title. "This was a physical one but I feel good."
After needing four hours and 23 minutes to beat Khachanov, it means Nadal has spent more than seven-and-a-half hours on court in three days and could face a physical encounter against another heavy hitter in Thiem.
"It'll be a tough one against Thiem. He hits the ball strong and has a big serve," Nadal added.
Serena Williams said her motivation to win major trophies remains as high as ever in motherhood after reaching the US Open quarters.
Williams, whose daughter Olympia turned one on Saturday, is aiming to win a record-equaling 24th Grand Slam title in New York.
The 36-year-old American former world number one is playing her seventh tournament since giving birth.
"That desire has not gone down at all," she said.
"And I don't think it was capable of going up, because if it was at a 10, I was at a 15 or a 20 – and I'm still there."
Williams, seeded 17th, has been in fine form at Flushing Meadows, dropping her first set of the tournament before recovering to win 6-0, 4-6, 6-3 against Estonia's Kaia Kanepi on Sunday.
Winning the US Open for a seventh time would see her level Australian Margaret Court's all-time record of 24 majors.
"My desire still remained at that incredibly high level to compete and to want to win," Williams said.
"It would be wonderful to win a Grand Slam while having a daughter, but it's a lot of work.
"It takes a lot of work to win those tournaments. I'm only in my third one back. I'm going to continue to grind and see what happens."
Meanwhile, Williams says she hopes to have more children in the future – but maybe not until after she finishes playing.
"Right now is not the time," she said. "I'm thinking about playing tennis and enjoying this time with Olympia.
"I'll have plenty of time in the future."