Lorenzo and Marquez managed to close the gap in the latter stages until the former slid out at the Turn 8 left-hander on the penultimate lap, which left Dovizioso with a clear run to victory.
Poleman Lorenzo hung onto the lead in the opening sequence of corners ahead of fellow front-row starter Jack Miller, as Marquez jumped to third ahead of Dovizioso.
But by the end of the lap Dovizioso had cleared both Marquez and Miller to move into second, and on the sixth lap of 27 he eased past Lorenzo on the run down to the Turn 8 left-hander to assume command.
By that time, Pramac Ducati man Miller had crashed out of what had become fourth, leaving the leading trio with a significant gap over the rest.
Dovizioso’s lead was hovering at less than a second until he set a new fastest lap on lap nine, and five laps later his advantage had grown to nearly two seconds.
Marquez and Lorenzo, engaged in a thrilling scrap over second, edged back towards Dovizioso in the final five laps but the Italian was able to stabilise his gap and finally take the chequered flag by 2.8s after Lorenzo’s crash.
Behind Marquez, LCR Honda’s Cal Crutchlow – who ran a lonely fourth for most of the race – was promoted to the final podium spot, a further 4s down on Marquez, followed by Suzuki man Alex Rins.
Yamaha’s Maverick Vinales failed to make the most of his front-row starting spot, slipping to fifth on the opening lap and ultimately ending up in the same position.
Teammate Valentino Rossi had a similarly indifferent run to seventh behind the second works Honda of Dani Pedrosa.
Andrea Iannone (Suzuki), Alvaro Bautista (Nieto Ducati) and Johann Zarco (Tech 3 Yamaha) completed the top 10.
Danilo Petrucci (Pramac) was handed a 1.1-second penalty for corner-cutting on his way to 11th, ahead of privateer Honda pair Franco Morbidelli (Marc VDS) and Takaaki Nakagami (LCR).
Rounding out the scorers were Aprilia man Aleix Espargaro and Ducati wildcard Michele Pirro, while Lorenzo remounted to finish 17th – one place ahead of Miller.
The other retirees were Xavier Simeon (Avintia Ducati) and Stefan Bradl (Honda), both crashing out, while KTM’s Pol Espargaro was forced to retire a little beyond half-distance.
Debutant Christophe Ponsson (Avintia) finished a lapped 23rd.