It was the Italian's second win of the season and 14th overall. Yamaha's Fabio Quartararo finished more than six seconds behind in third, and seven-time former world champion Valentino Rossi was fourth for his best result since coming runner-up at the GP of the Americas in April.
Honda rider Marquez, who took a record 59th pole in Saturday's qualifying, dropped to fifth soon after the start as Quartararo and Dovizioso went 1-2. However, from the eighth lap the race became a duel between Marquez and Dovizioso, with the rest of the field following several seconds behind.
The pair swapped the lead several times but Dovizioso placed the decisive attack in the same turn where he beat Marquez in a similar finish to the 2017 race. Dovizioso denied Marquez his first victory in Austria, the only track on this year's calendar where he has yet to win a race.
Chasing his sixth championship, Marquez leads with 230 points in the overall standings after 11 of 19 races. Dovizioso is second with 172 and his Ducati teammate Danilo Petrucci, who finished ninth, is third with 136.
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports