Querrey rebounded from being blanked in the first set for a 0-6, 7-6 (7-5), 6-4 win. It was the first time in five career meetings Querrey defeated Djokovic. Querrey had won just one set in the previous four matches.
Djokovic lost just 10 points in a first-set blitz but Querrey only lost serve once in the second and third sets while getting one break himself in each to advance.
Even with the loss Djokovic will retake the world No. 1 ranking Monday. However, it does leave the year's final Masters tournament without three of the Top 4 players. Current No. 1 Roger Federer withdrew to rest for next week's ATP World Tour Finals in London, and fourth-ranked Rafael Nadal is out with a knee injury.
Also Wednesday, third-seeded Briton Andy Murray advanced with a 7-5, 6-3 decision over Frenchman Paul-Henri Mathieu and red-hot seventh seed Juan Martin del Potro -- seeking his third title in three weeks -- registered a 6-2, 6-2 rout of Colombian qualifier Alejandro Falla.
Other early second-round results saw fourth-seeded David Ferrer dump Marcel Granollers 6-1, 6-3 behind five breaks.
No. 12-seeded Richard Gasquet was beaten by Kevin Anderson 7-6 (7-5), 4-6, 6-1, a decision that ended Gasquet's hopes of qualifying for the World Tour Finals.
Janko Tipsarevic, the No. 8 seed, enhanced his chances of taking a spot in London with a 6-4, 7-6 (7-0) decision over Igor Sijsling and ninth-seeded Juan Monaco beat Grigor Dimitrov 7-6 (7-4), 6-2.
Also Wednesday, Gilles Simon stopped Victor Hanescu 7-5, 6-3. Hanescu filled Federer's spot in the draw.
Swim Week Miami Beach 2014 [PHOTOS]