Defending champion Djokovic was 4-2 ahead in the first set when Russian 34-year-old Youzhny called it quits suffering from a left hamstring injury.
The outcome completed a bizarre first week for world number one Djokovic.
After labouring over four sets to beat Jerzy Janowicz on Monday, he was handed a walkover into the third round when Czech opponent Jiri Vesely withdrew from their second round clash with an arm injury.
“I have never had this happen before in my Grand Slam career, getting a walkover and the next match lasting just half an hour,” said Djokovic.
The top seed next faces Britain’s world number 84 Kyle Edmund who stunned John Isner of the United States 6-4, 3-6, 6-2, 7-6 (7/5) to make a Slam fourth round for the first time.
Nadal reached the fourth round for the first time since 2013 — the year of his last New York title — with a 6-1, 6-4, 6-2 win over Russia’s Andrey Kuznetsov.
“Andrey is always a tough opponent, he returns well and has good shots from the baseline,” said fourth seed Nadal who faces France’s Lucas Pouille for a quarter-final slot.
“I had a fantastic first set, a little trouble with my serve in the second but the third was key so I’m very happy.”
Djokovic’s very brief encounter had been preceded on Arthur Ashe Stadium by women’s eighth seed Madison Keys pulling off an epic comeback to beat Japan’s Naomi Osaka.
Keys won the latest-ever finishing women’s match at the tournament on Monday when she completed victory over compatriot Alison Riske at 1:48am.
On Friday, the 21-year-old was involved in more drama when she rallied from 1-5 down in the final set to defeat Osaka 7-5, 4-6, 7-6 (7/3).
Keys benefits from choke
The 18-year-old Osaka was so traumatised by her failure to convert her dominance into victory that she broke down in tears as she twice tried and failed to serve for the victory.
“This is the greatest comeback of my career, hands down,” said Keys who will face two-time runner-up Caroline Wozniacki for a quarter-final spot.
In stark contrast, German second seed and Australian Open champion Angelique Kerber closed out the night session with a 6-1, 6-1 win in just 53 minutes against American 17-year-old CiCi Bellis.
Kerber, who claimed her season-leading 50th match win, next faces two-time Wimbledon winner Petra Kvitova.
Jack Sock, the American 26th seed, reached the fourth round for the first time by knocking out 2014 champion Marin Cilic 6-4, 6-3, 6-3 in tie where he did not face a single break point.
The 23-year-old Sock, whose last two appearances at the US Open had ended in retirements, goes on to face French ninth seed Jo-Wilfried Tsonga.
Tsonga, a two-time quarter-finalist, made the last 16 with a 6-3, 6-4, 7-6 (7/4) victory over South Africa’s Kevin Anderson.
Wozniacki, who knocked out ninth-seeded former champion Svetlana Kuznetsova in the second round, clinched a seventh win in seven meetings over unorthodox Monica Niculescu of Romania.
The Dane’s 6-3, 6-1 victory featured eight breaks of serve.
Roberta Vinci, the Italian seventh seed and runner-up to compatriot Flavia Pennetta in 2015, overcame a second set blip to defeat 21-year-old Carina Witthoeft 6-0, 5-7, 6-3.
The 33-year-old Vinci led 5-4, 30-0 in the second set before her 84th-ranked German opponent dug deep to take the tie into a decider.
But Vinci prevailed on the back of 40 winners and will meet Lesia Tsurenko of the Ukraine for a quarter-final place.
Tsurenko, the world 99, made the last 16 at a Slam for the first time by beating 12th seed Dominika Cibulkova 3-6, 6-3, 6-4.
The 27-year-old Tsurenko committed 44 unforced errors. Fortunately for her, newly-married Cibulkova hit 54.
Latvia’s Anastasija Sevastova backed up her shock victory over third seed and French Open champion Garbine Muguruza by making the last 16 for the first time with a 6-4, 6-1 win over Kateryna Bondarenko of the Ukraine.