The Scot, who suffered no repeats of the body cramps that caused such discomfort in the first round, took two hours and 35 minutes to beat the world No 97 6-1, 7-5, 4-6, 6-2 and set up a match with either Jo-Wilfried Tsonga or Spain's Pablo Carreno Busta tomorrow.
Loading article content
That would leave Murray just one victory away from a potential meeting with world No 1 Djokovic, who destroyed American Sam Querrey in straight sets.
"I got off to a good start and had a cushion when he came back into it. I tried just to stay solid but it was a tough match," Murray said.
"There were a lot of long rallies. I feel better than I did in the first round. I ate and drank the right things and I felt fine and definitely better than the other day."
Djokovic, meanwhile, is looking back at his imperious best after arriving in New York off the back of unusually disappointing runs in Toronto and Cincinnati.
The Serbian said: "I am peaking at the right time, at the right tournament. This is where I want to play my best tennis.
"I didn't do as well as I wanted in the lead-up tournaments, Toronto and Cincinnati.
"I didn't know how emotionally drained I was in a way until I played Tsonga in Canada and … I didn't feel I could deliver my best.
"That's something that, when I analysed … what I had two months before, was normal in a way. I was expecting of myself, and I always am expecting from myself, the best and to go as far as I can.
"Obviously, emotionally I wasn't ready for those tournaments. But the upside of losing early in Cincinnati is that I had more time to prepare for the US Open." l Report, page 15