They tracked down would-be winners and somehow got them back, prolonging points that involved 10 or 20 strokes or more, extended by Djokovic's slides and splits and Murray's gifted anticipation.
After one 30-shot masterpiece on his way to victory, Djokovic raised his right fist, bellowed, "Come on!" and windmilled his arms to rile up the crowd.
Eventually, the physically demanding action proved too much for a fading Murray, and Djokovic pulled away to win 7-6 (1), 6-7 (1), 6-2, 6-4 and reach the tournament's semifinals for the eighth consecutive year.
"I knew coming into tonight's match that it's going to be tough, that he's going to go for his shots and the more aggressive one would win it," the No. 1-ranked and No. 1-seeded Djokovic said. "I'm glad I managed to stay fit in the end and pull it through."
It took a while for him to push out front in a 3-hour, 32-minute match that ended after 1 a.m. ET Thursday.
Asked in an on-court interview to look ahead to facing 10th-seeded Kei Nishikori of Japan in Saturday's semifinals, Djokovic joked: "My thoughts are just directed to sleeping right now."
That drew guffaws from spectators, and he continued: "Or party. What do you say? Let's party. I think my coach right there would chase me with a little baseball bat if he saw me going to the city to party right now."
Djokovic broke the eighth-seeded Murray to go up 3-1 in the third set, then fended off a pair of break points in the next game. On the first, Murray sailed a backhand long to end a 28-stroke point, then leaned over and put a hand on his knee. On the second, he dumped a forehand into the net, then slammed his racket against his right thigh and yelled.
Soon, Murray was turning to his box to say, "Nothing in the legs." In the fourth set, a trainer came out to deliver a heat pack to Murray.
"I got stiff in my hips and my back. ... I don't know exactly why," said Murray, who beat Djokovic in the finals at the US Open in 2012 and Wimbledon in 2013. "I didn't hurt anything. It was just, I think, fatigue."
He had back surgery a year ago, and in his first-round match in New York last week, he barely managed to overcome cramps all over his body. Murray had looked fine since then, but he couldn't sustain his top form throughout the physically demanding quarterfinal against Djokovic, who won the US Open in 2011 and has played in the past four finals.
"He was fresher toward the end," Murray said. "I tried to hang in as best I could."
Nishikori became the first man from Japan to reach the US Open semifinals since Ichiya Kumagae in 1918, outlasting third-seeded Stan Wawrinka of Switzerland 3-6, 7-5, 7-6 (7), 6-7 (5), 6-4 earlier Wednesday.
That match lasted more than four hours, and Nishikori managed to shake off any lingering exhaustion from his previous victory, which took 4:19 and ended at 2:26 a.m. Tuesday, equaling the latest finish in tournament history.
Until the third set, Djokovic-Murray was reminiscent -- in terms of pure entertainment value and setting, if not quite star power -- of the 2001 classic between Pete Sampras and Andre Agassi, which also was a quarterfinal and under the lights at Arthur Ashe Stadium. That one, won by Sampras, featured four tiebreakers, because neither man broke serve even once.
If the sublime-serving Sampras against the terrific-returning Agassi provided a contrast in styles, Djokovic versus Murray was more a case of mirror images. Two of today's top returners, they combined for 11 service breaks, seven by Djokovic, including in the final game. They also are both brilliant baseliners and retrievers, and it helps that they know each other -- and each other's patterns -- so well.
Born a week apart in May 1987, they have played 21 times; Djokovic leads 13-8. Both of Murray's major titles came via victories over Djokovic. Two of Djokovic's seven major trophies -- at the Australian Open in 2011 and 2013 -- came against Murray.
Wednesday's opening set was a thing of beauty, a 73-minute exercise in shape-shifting and shot making. In the tiebreaker, though, Murray lost his way at a most inopportune time: He entered the night 0-8 against Djokovic when dropping the first set. Murray double-faulted, put a return into the net and flubbed a backhand, and before he knew it, that set was gone.
Djokovic went up a break in the second set. Murray broke back. Djokovic took another of Murray's service games. And, yes, Murray again broke back, delivering a forehand winner that left an angered Djokovic swatting a spare ball off the serve-speed digital readout.
Murray dominated that set's tiebreaker, but soon enough, he was the one who was frustrated.
"I don't feel particularly proud right now," Murray said. "I feel disappointed."
Djokovic Moves Past Murray
SportsCenter Highlight of the Night: Novak Djokovic defeated Andy Murray in four sets to advance to the semifinals at the US Open.
Djokovic Outlasts Murray
Novak Djokovic talks about his win against Andy Murray to advance to the semifinals at the US Open.
Digital Serve: US Open Day 11
Prim Siripipat and Patrick McEnroe look ahead to the biggest matches at day 11 of the US Open.
Nishikori Wins In Five Sets
Kei Nishikori beat Stan Wawrinka in five sets to advance to the semifinals at the US Open.
Five Things We Learned: US Open Day 10
Greg Garber and Howard Bryant break down five things they from the tenth day at the US Open.