Hamilton admitted an embarrassing auto accident in Monte Carlo this week
had been down to his recent frantic lifestyle, but appeared to be on course to re-assert his dominance when he led the first two sessions of qualifying in his Mercedes.
But on the final decisive run of qualifying session three, the Briton locked up and Rosberg pipped him by a tiny margin of 0.078 seconds to take first place on the grid for Sunday's race at Interlagos in Sao Paulo.
Hamilton wrapped up the championship in dramatic fashion in Texas with three rounds remaining, overtaking Rosberg in the closing stages.
Rosberg gained a measure of revenge in Mexico by converting his pole position into a victory, with Hamilton relegated to second.
A repeat could be on the cards in the penultimate race of the season, but Hamilton is determined to record his first win at the famous track and home of his boyhood hero Ayrton Senna.
"It is a circuit I haven't won at. Last year I was stronger in the race and I hope that will make the difference."
Rosberg is battling for second in the championship with Ferrari's Sebastian Vettel, who will start third on the grid after another solid performance.
Williams driver Valtteri Bottas was fourth fastest but will drop three places after a penalty for a practice transgression.
Ferrari's Kimi Raikkonen, Force India's Nico Hulkenberg and Red Bull's Daniil Kvyat move up ahead of him.
But it was another miserable afternoon for the McLaren-Honda team with Fernando Alonso left stranded on the track and engaging in some impromptu sun bathing while he waited for a lift back to the pits. Teammate Jenson Button was only 17th best.
The tragic events in Paris were uppermost in the thoughts of the drivers, particularly Romain Grosjean of Lotus, the only Frenchman on the grid, while Hamilton also took to social media with the same sentiment.
Sadly, Grosjean had little to celebrate in qualifying, taking 15th spot.