The British driver is 19 points behind his Mercedes colleague and really needs to win at the Interlagos circuit in Sao Paulo Sunday to have any chance of taking the championship to a decider in Abu Dhabi.
He finished 0.1 seconds ahead of the German driver who is looking for his first world title.
Ferrari's Kimi Raikkonen will start in third place, ahead of Red Bull's Max Verstappen and Sebastian Vettel in the other Ferrari.
Daniel Ricciardo, Romain Grosjean, Nico Hulkenberg, Sergio Perez and Fernando Alonso make up the rest of the top 10 on the grid.
Both Williams cars, driven by Valtteri Bottas and Felipe Massa, failed to make the last round of qualifying and will start lower down the grid.
It will be particularly disappointing for Massa who is racing in his last home grand prix after announcing his retirement at the end of the season.
It was the 60th pole of Hamilton's career -- but he has never won in Brazil so victory in Sunday's race will notch up another first at the birthplace of his hero Ayrton Senna.
"I felt quite comfortable in qualifying as I have done all through the weekend," he told reporters after the session.
Hamilton, the three-time world champion who is wearing a tribute helmet to Senna, added: "Nico generally has been going quicker as the weekend has gone on, but generally I have had it covered."
Rosberg, who is still favorite to take the championship, responded by saying: "Lewis was just marginally quicker in the end. Anyway, as we have seen this year, pole is not the guy who will necessarily win the race."
The rivalry between the two Mercedes drivers is intense and has occasionally turned ugly. The pair collided in the Spanish Grand Prix in May, putting them both out of the race, and tensions have spilled over off the track too.
Ahead of last year's podium ceremony at the US Grand Prix, Hamilton tossed a cap in Rosberg's direction only for the German to frustratedly sling it back
-- Hamilton's had just clinched the world title with victory in Austin.
But former Mercedes team principal Ross Brawn told CNN he believes the situation can be managed.
"If you look at Prost-Senna or other situations where two drivers are fighting genuinely for a world championship, it's a pretty delicate situation," he said. "It's easy for that stuff to boil over.
"I think it's a testament to both Nico and Lewis and the management of the team which has kept it fairly level."