Championship leader Lewis Hamilton, a point ahead of Brazilian Massa in the standings with four races remaining, steered his McLaren to second on the grid with world champion Kimi Raikkonen to start third for Ferrari on Sunday.
It was the fifth pole position of the season for Massa, who also qualified quickest at the Monaco and Valencia street circuits.
Massa's time of one minute 44.801 seconds was a massive 0.664 seconds quicker than Hamilton.
BMW-Sauber's Robert Kubica qualified in fourth place while McLaren's Heikki Kovalainen was fifth.
Double world champion Fernando Alonso, who had topped the final two practice sessions and looked set to challenge for pole, suffered a huge disappointment when his engine died and he cruised to a halt midway through the second qualifying session.
The Spaniard held his head in his hands in frustration as his chance of a decent grid position evaporated.
But there was joy for the Williams team, who managed to get both their drivers in the top 10 for the first time this season.
Germany's Nico Rosberg will start from ninth on the grid while Japan's Kazuki Nakajima drove an inspired qualifying session to finish 10th, the best grid position of his career.
Toro Rosso's Sebastian Vettel, the 21-year-old who in Italy two weeks ago became the youngest driver to qualify on pole position before going on to become the youngest winner, qualified seventh.
Hamilton, who scraped into final qualifying by the skin of his teeth after a sub-par second session, said the experience of racing at night was still new to the drivers.
Qualifying got under way at 22:00 local (15:00 BST) in the South East Asia city-state, and Sunday's race begins at 20:00 (13:00 BST).
"Tonight was kind of crazy, quarter past 11 at night right now and I've never been driving at this time before. It is quite unique," said Hamilton.
The 23-year-old Briton acknowledged he was lucky to even make it into the third and final qualifying session after ending on the bubble in 10th place in Q2.
"I just missed my first lap. Unfortunately I didn't have enough fuel to do another lap so I had to come back in," he added.
"When I came back out I got stuck in traffic. It was very, very fortunate I got through."
Singapore GP - Qualifiying