Djokovic was brutally efficient in the first set after walking unsmiling onto the court as the remaining fans made their way from the stadium's upper reaches to the lower bowl. Querrey, who will take over as the top-ranked American in the next ATP Tour rankings, fought back in the second set.
Djokovic held at 6-all to force the tiebreaker, in which he took a 5-1 lead. Querrey rallied again to tie it at 6-all on a forehand crosscourt winner as some fans yawned.
But then Querrey committed two straight errors to end the 1-hour, 25-minute match.
"It's been a very long day for all of us and I'm very grateful for all of you staying," Djokovic told the few hundred fans who stuck around. "Obviously, it was very frustrating waiting the whole day and then going out after midnight."
Djokovic stayed loose by kicking around a soccer ball on the grounds as he waited for the backlogged day session, which included four straight three-set matches, to finish and for Maria Sharapova to complete the first night match.
"I was really frustrated and trying to hold my emotions," Djokovic said.
Sharapova defeated sixth-seeded Sara Errani 7-6 (6), 6-2 to reach the women's semifinals without dropping a set. She next plays No. 13 seed Maria Kirilenko, who beat No. 5 Petra Kvitova 4-6, 6-4, 6-3 to make the semis for the first time here. Kirilenko improved to 6-0 in three-set matches this year.
Rafael Nadal ended the run of Latvian qualifier Ernests Gulbis with a 4-6, 6-4, 7-5 victory that set up a quarterfinal against defending champion Roger Federer, who survived a three-set marathon of his own, beating 18th-seeded Stanislas Wawrinka 6-3, 6-7 (4), 7-5.
Gulbis was on a 13-match winning streak, having made his way through the qualifying rounds at Delray Beach, Fla., where he won the title, and at Indian Wells, where he won three main-draw matches, including two over seeded players.
He was playing his 14th match in 19 days, and has yet to beat Nadal in five tries.
"I think that I played better tennis. I was more aggressive," Gulbis said. "I went for my shots much more than he. But he did really incredibly well, as he always does, on important points."
Gulbis held serve to lead 5-4 in the third. He led 30-15 on Nadal's serve, but lost the next five points to let Nadal tie the set.
Nadal earned the only break of the third to go up 6-5, then closed out the win on his third match point. He leaped, tore off his headband and pumped his left arm, yelling, "Yeah!"
"With all the problems, I was able to keep being focused and keep winning," he said. "I really appreciate every moment and every victory."
The fifth-seeded Spaniard opened his bid for a third Indian Wells title with a two-set victory over American Ryan Harrison, Nadal's first hard-court match in nearly a year.
He returned to the ATP Tour a month ago, winning two of three tournaments on clay after missing seven months because of a left knee injury. Nadal, shaken by an earthquake that rattled Indian Wells on Monday, had a walkover in his third-round match when Leonardo Mayer withdrew with a bad back.
"I said before the tournament my knee, some days good, some days not that good. Today so-so," he said. "But I fought. I fought every ball."
Wawrinka's consecutive forehand errors in the gathering dusk of an unusually hot day in the California desert closed out his 10th consecutive loss to Federer on hard courts. The temperature reached 96 degrees nearly 20 degrees above normal during the day.
Federer, a four-time champion at Indian Wells, is going for his first ATP Tour title since last August. He'll have to get by Nadal in the earliest meeting between the two stars since the first time they played each other in 2004.
"In the past, this match used to be a final. Now it's a quarterfinal, so obviously it's a bit of bad luck of the draw for both of us," Federer said, noting that between his bothersome back and Nadal's left knee "we are both a bit suspect."
Nadal said he doesn't think his level of play is yet up to what he's normally capable of against Federer.
"This match arrives too early for me to go to the match with the feeling that I can play equal conditions," he said. "Two weeks ago, I didn't know if I would be able to be here. Being in quarterfinals is a fantastic result for me, and we'll see."
Federer, ranked second, improved to 13-1 against the 18th-seeded Wawrinka, who was broken twice in the final set played in front of tennis great Rod Laver.
"I don't know what gets me through. Maybe it's the experience or maybe a bit more calm in those moments," Federer said. "Today, I think I was a little lucky to come through it."
Federer was broken once in the third set after telling the chair umpire he didn't have enough time to challenge the call on his first serve. He lost that argument and the game, but broke Wawrinka right back to tie it 3-all. From there, both players held until Federer broke Wawrinka at love in the last game.
Federer tweaked his back in his fourth-round match and was glad to have Tuesday off to recover.
"I played three sets over 2 hours, so I'm happy at what level I can compete," he said. "I'm hopeful that it's going to feel a bit better again tomorrow, another step forward."
On the men's side, No. 3 Andy Murray beat Carlos Berlocq 7-6 (4), 6-4 to advance to a quarterfinal against No. 7 Juan Martin del Potro, who routed No. 19 Tommy Haas 6-1, 6-2.
Berlocq complained to the chair umpire that Murray was taking too long between points, prompting Murray to protest the volume of Berlocq's grunting.
"It was extremely, extremely loud, more than what I have experienced from any other player on the tour," Murray said. "If it's going to be suggested that I am using gamesmanship by taking too long, then you can't be making noises like that on the court. It's annoying."
Berlocq said he didn't realize the sound would bother Murray.
"Well, yeah, but that's what all of the real grunters say," the Scotsman retorted.
No. 6 Tomas Berdych beat No. 10 Richard Gasquet 6-1, 7-5; No. 8 seed Jo-Wilfried Tsonga outlasted No. 17 Milos Raonic 4-6, 7-5, 6-4; and Kevin Anderson defeated No. 13 Giles Simon 6-3, 1-6, 6-4.