Following late rain in FP1, Friday's second practice at Phillip Island got underway on almost completely dry circuit.
Championship leader Valentino Rossi held the early P1 as he hit the front with a 1:30.557 while Yonny Hernandez was a surprise in second place. The Pramac Racing rider slotted into second place, 0.3s down, while Jorge Lorenzo was third.
But as the riders laid down the laps in the blustery conditions the times rapidly began to fall.
Marquez had a brief spell at the front before Lorenzo took over. The Yamaha rider, who trails Rossi by 18 points in the standings, posted a 1:30.103 on his fifth lap of the afternoon. He continued to take tenths out of his time, lowering the benchmark to a 1:30.082.
Heading out for a final run on fresh tyres, Cal Crutchlow went quickest then Lorenzo and finally Marquez.
The reigning World Champion put in a late lap to cross the line with a 1:29.383. That put him 0.050s up on Lorenzo while Maverick Vinales slipped through to finish third, 0.135s down.
Andrea Iannone was fourth ahead of Crutchlow, Dani Pedrosa and Pramac Racing's Danilo Petrucci. Rossi was P8, 0.658s off the pace.