"There's nothing better than playing in front of the home crowd here in New York," Sock said. "I put it out there on the line on every point."
Top seed Djokovic cannot seem able to get an on-court workout after Youzhny retired due to a leg injury when trailing 4-2.
Youzhny was treated during the changeover at 4-1 in the third-round match at Arthur Ashe Stadium and had his left thigh taped. He won the next game on his serve but could not continue, giving Djokovic a pass into the round of 16.
The Serb, winner of this year's Australian Open and French Open to complete a career grand slam, came into the match off a three-day break due to a walkover into the third round when Jiri Vesely of the Czech Republic withdrew.
"It's difficult to pick the words now. I don't think I ever had this kind of situation in my career, where I had a second-round walkover and the third round 30 minutes only," Djokovic said on court before heading off to practice.
"I'll try to get the positives out of these six games. Obviously I did start very well with a good intensity and I'll try to carry that into the next match."
Defending champion Djokovic will next face either 20th-seeded American John Isner or 84th-ranked Briton Kyle Edmund with a berth in the quarter-finals at stake.
Djokovic, who has been bothered in recent months by a nagging wrist injury, won his opening match at Flushing Meadows on Monday, 6-3 5-7 6-2 6-1 over 247th-ranked Jerzy Janowicz of Poland.
- AAP