Valtteri single-handedly fought the two Ferraris for pole, but after topping Q1 the Finn trailed Sebastian Vettel going into the final run of the final shootout.
But while Vettel failed to improve on his final flier, Valtteri clocked a 1:08.322s to edge the Ferrari to the top spot by just 0.038s - securing his third career pole.
"It was so close in qualifying, as it always tends to be in Brazil," said Valtteri. "I knew going into the last run in Q3 that I had to improve if I wanted to be on pole. I could feel and see that I was improving corner after corner.
"It's such a good feeling to get everything together in the end. It was very unfortunate that Lewis wasn't there for Q2 and Q3. So it was up to me to deliver for the team, and I'm very happy that I could.
"I have the clear goal to still try and become second in the Drivers' Championship. Having a good target makes everyone in the team work harder, including myself.
"It's going to be important to have a good, clean race tomorrow, but it won't be easy, the Ferraris are very quick as well. Turn 1 and 2 are always tricky in Interlagos, but hopefully I will get a good getaway so there won't be any issues.
"It's only my third pole position, so I will very much like the view from the starting line tomorrow."