The Finn set his best of 1:36.231 on his first run in Qualifying 3 before abandoning his final lap as Hamilton mounted his final charge.
At the first sector split, Hamilton held a small advantage, which then eroded through the remainder of the lap to qualify second by 0.172s.
It was Bottas' fourth career pole, and the first time he's recorded the fastest qualifying time in consecutive grands prix.
Sebastian Vettel could do nothing more than settle for third on 1:36.777, ahead of Daniel Ricciardo who split the two Ferraris as the chequered flag fell.
The second Ferrari of Kimi Raikkonen had set the early pace in Qulaifying 3, but found his time immediately bettered by Valtteri Bottas' pole effort.
Raikkonen ended the session fifth fastest, alongside Max Verstappen in sixth.
Massa's Williams team-mate Lance Stroll escaped the first phase of qualifying in the dying moments, only to become the first driver eliminated from Qualifying 2.
The Canadian driver was 15th fastest in the session, one spot back from Kevin Magnussen.
Both McLaren drivers also failed to progress, with Carlos Sainz in the Renault also unable to progress into the final ten, the Spaniard's progress was hampered by complaints of a lack of power from his Renault powerplant.
Having struggled for pace throughout practice, it proved unsurprising to see Brendon Hartley the slowest qualifier, 0.8s off the back of Toro Rosso team-mate Pierre Gasly.
Between them will start the two Saubers of Pascal Wehrlein and Marcus Ericsson, while Romain Grosjean fell into the bottom five as Stroll banked the lap after the chequered flag as he escaped the initial cut.
The Abu Dhabi Grand Prix, which is the final round of the 2017 Formula 1 season, is set for a midnight AEDT start on Sunday night.
Results: Formula 1 Abu Dhabi Grand Prix Qualifying
|Carlos Sainz Jr.