The Italian was the only rider in the field who got into the 1:19s during a hotly contested qualifying session.
Bagnaia set a time of 1:19.931 which was just enough to hold off world championship rival Quartararo who finished less than a tenth of a second behind.
The two men will be joined by Prima Pramac Racing's Johann Zarco after the Frenchman sealed his place on the front row.
Once Bagnaia had set his time, the battle for second proved enthralling as Aleix Espargaro and Quartararo were taken over by Zarco who set an impressive time of 1:20.030.
Somehow, that didn't prove enough to seal second as Quartararo, who leads the world championship, dug deep and cut his time to 1:20.007 just before the chequered flag.
Fabio Di Giannantonio will start Sunday's race from fifth after putting on an impressive display in the second part of qualifying.
The Italian was as high as third before slightly dropping down the standings during the closing stages of the session.
Nevertheless, Di Giannantonio will start ahead of Australia's Jack Miller, who still faces an investigation after allegedly crashing under a yellow flag during FP4.
Seventh on the grid will be Luca Marini while closing out the top eight is Jorge Martin, who will consider himself unlucky after finishing a mere 0.288s from pole.
Maverick Vinales sneaked into the third row while 10th spot went to Japan's Takaaki Nakagami who endured a late crash in the first turn.
Rounding off the fourth row will be Marco Bezzecchi and Joan Mir. The latter of the two men will be desperate to make his first podium of the season after already notching three fourth-placed finishes in this campaign.