Rosberg has had his nose ahead of Hamilton all weekend, but Hamilton topped the top 10 shootout after the first laps were set, heaping pressure onto his teammate for the ultimate lap of the session.
Rosberg set his final lap first with three purple sectors, but the trailing Mercedes beat the German’s first sector time, meaning little separated the pair when Hamilton rounded the final turn.
The Briton came close to stealing pole, but his lap fell short by an agonising 0.013 seconds, winning Rosberg his third consecutive pole position at Suzuka.
“Of course I‘m happy with the result in the end,” he said. “I’m feeling good, feeling comfortable, which is what allows me to put in a lap like that in the end. I’m pleased with that.
“I had a good balance on the car. It’s just putting everything together.”
Hamilton didn’t present too unhappily, perhaps in the knowledge that he won the previous two races in Japan from second place against a pole-sitting Rosberg.
“I did as well as I could,” he said. “I’m generally very happy with that, and history has shown that you don’t have to be on pole to get the win.
“It’s been a weekend of a lot of work getting the car set up right. Considering that, to be that close, I’m really happy with that.”
Rosberg will start the grand prix knowing that a win will earn him enough points to allow him to finish second for the rest of the season and still claim the title.
Mercedes is almost certain to win the constructors championship tomorrow regardless of the result; the team needs only to ensure Red Bull Racing doesn’t outscore it by more than 22 points.
Kimi Räikkönen was the fastest non-Mercedes driver after the Finn set a time just 0.3 seconds behind the Mercedes cars on the front row.
Räikkönen has looked switched on all weekend despite complaining during practice of poor balance, and he was pleasantly surprised to end up leading the second row of the grid.
“It’s pretty much the same car that we raced a week ago,” he said. “I was very positively surprised how well the car’s been behaving and how quick it’s been.
“Obviously it’s been a bit tricky to get the right balance, but it’s been pretty good. It’s not exactly what we’re looking for, but it was pretty close. It’s not too bad.”
Sebastian Vettel was 0.079 second slower than Räikkönen, but the German will serve a three-place grid penalty for his first-turn crash at last weekend’s Malaysian Grand Prix, dropping him to seventh on the grid.
Max Verstappen will be promoted to fourth after setting the fifth-quickest time good enough for a 0.062-second buffer to Red Bull Racing teammate Daniel Ricciardo.
Sergio Perez will also take a one-grid-place boost, from seventh to sixth, in his Force India.
The Mexican set the same 1 minute 31.961 second lap time as Romain Grosjean, but Vettel’s penalty slots the German between the two.
Grosjean will remain in eighth, split from his teammate Esteban Gutierrez in P10 by Nico Hülkenberg’s Force India, making the Japanese Grand Prix the first race for which Haas has qualified both cars in the top 10.
Williams was edged out of the top ten after neither driver could string together a competitive lap on their single Q2 opportunity; Valtteri Bottas leading Felipe Massa by less than a tenth of a second in eleventh and twelfth.
Neither McLaren-Honda car could give the Japanese fans much to cheer about. Jenson Button was eliminated in Q1 with a paltry P17, and Fernando Alonso could manage just two places better in Q2, earning fifteenth on the grid.