The Honda rider played a patient game across the 27 laps, pulling clear of what had been a frantic scrap for the lead with Valentino Rossi and Johann Zarco with five laps to go to storm to an ultimately comfortable win.
Even better for Marquez was that Dovizioso struggled, the Motegi winner only able to recover to 13th after running wide at Turn 2 on the second lap of the race.
Jack Miller put in a crowd-pleasing opening stint to the race, charging into the lead on the first lap and making a break for it out front.
He was then passed by Maverick Vinales but it was Rossi that enjoyed the next decent stint at the front.
Rossi never looked comfortable, though, and on lap nine succumbed to the pressure being piled on by Johann Zarco - the only of the front-runners to run the soft compound front tyre - and ran wide at Honda.
That left Zarco in front, but with Marquez right on his rear Michelin with the rest of the lead group of eight bikes not far behind.
Despite Marquez putting all the pressure on Zarco, it was Rossi that took over at the next lead change.
With 11 laps to go Zarco pulled the same move, dive-bombing Rossi at Honda to re-take the lead, before Rossi again reversed the positions at the same spot the next lap.
Vinales was next to lead as Marquez and Rossi made light contact as they squabbled over second on the run to Honda.
Marquez quickly recovered and had the blowtorch on Vinales a lap later, grabbing the lead at Honda.
Vinales kept going backwards too, being shuffled outside the top four after an ambitious move from Zarco at Turn 1 a lap later.
With five laps to go the eight-bike train finally broke apart, a clear front four consisting of Marquez, Rossi, Zarco, and Andrea Iannone pulling away.
Marquez then made his play to pull away on the next lap, banking a 1m30-dead to pull a 0.6s lead.
It worked perfectly, the gap enough to set Marquez up for a 1.7-second win.
The frantic battle behind the winner came down to the run to the flag, Rossi just getting the job done ahead of his team-mate Vinales, who fought his way back into the battle for the podium.
The gap between the two Yamahas was just 0.02s, Zarco just 0.1s back in fourth.
Despite his podium finish, Vinales is now officially out of the title fight, with a 50-point gap to Marquez.
Cal Crutchlow was best of the rest in fifth, with Iannone's frantic ride ultimately only yielding sixth.
Miller finished an impressive seventh on home soil, with Alex Rins coming home eighth, ahead of the two KTMS of Pol Esparharo and Bradley Smith.
The race couldn't have gone much worse for title contender Dovizioso.
On just the second lap he was lucky to escape running wide at Turn 1, dropping all the way down to 20th.
His fightback was hardly convincing either, the Ducati rider only getting as high as 11th, and then dropping to spots on the run to the flag to finish 13th.
He's now 33 points behind Marquez.