Honda rider Marquez lowered the existing lap record set during Saturday morning’s third practice session by nearly four tenths as he posted a 1m58.168s lap at the end of the 15-minute pole shootout, 0.428s up on old rival Rossi.
During the first runs, Marquez had been shaded by the Petronas SRT Yamaha of Fabio Quartararo, who posted a 1m58.612s to go half a tenth up on the reigning champion.
But the Frenchman was forced to swap to his second bike for the final part of the session, and narrowly missed out on improving on that time, leaving him vulnerable as his rivals all found chunks of time on their final flyers.
Works Yamaha rider Rossi briefly went top on a 1m58.596s, and that was still enough for second, matching his best qualifying effort of the season, while Jack Miller went third-quickest on the Pramac Ducati, knocking Quartararo down to fourth.
Joining Quartararo on the second row was Suzuki rider Alex Rins, who made it out of the first segment of qualifying, and the second factory Yamaha of Maverick Vinales, although Vinales was on course to go quickest before losing time in the final sector on his last lap.
The second LCR machine of Takaaki Nakagami, Danilo Petrucci (Ducati) and Aleix Espargaro (Aprilia) completed the Q2 order.
Q1: Dovizioso top, KTMs miss the cut
In Q1, Rins set the early pace on a 1m59.436s, but that was beaten with around a minute to run when Dovizioso moved to the top of the timesheets on a 1m58.944s.
Rins improved to a 1m59.190s to book his place in Q2, comfortably clear of third-placed Pol Espargaro, who leads an all-KTM fifth row.
Johann Zarco showed improved form by qualifying within a tenth of Espargaro in 14th, one place ahead of the Tech 3 KTM of Miguel Oliveira.
Suzuki stand-in Sylvain Guintoli, who attracted the ire of Espargaro during Friday practice, will start 19th on the second of the GSX-RRs.
Beleaguered Honda rider Jorge Lorenzo could only manage 21st on the grid for his first MotoGP race since June’s Catalan Grand Prix, ending up 2.6s off the pace of former teammate Dovizioso and ahead only of Karel Abraham’s Avintia Ducati.
Results to follow