Marquez moved into second place with 21 laps to go, with Lorenzo third before the champion snatched the lead with 16 laps remaining.
Marquez crossed the line in 42min 7.041sec, followed by Lorenzo, who slipped past Rossi with 12 laps left.
Marc Marquez heads for his 10th straight win.
The world champion now has a perfect 250 points with Honda team-mate Dani Pedrosa, who was fourth on Sunday, in second spot on 161.
Rossi has 157 points while 2010 and 2012 champion Lorenzo is on 117 points ahead of the 11th round of the championship at Brno in the Czech Republic next weekend.
Pole-sitter Mika Kallio scored a runaway win in a restarted Moto2 race with Maverick Vinales and Dominique Aegerter joining the Finn on the podium.
Kallio triumphed in a shortened 16-lap contest, with the race cut short by a red flag due to a crash involving Azlan Shah, Anthony West, Mattia Pasini and Randy Krummenacher.
Meanwhile, Australia's Jack Miller finished third in the Moto3 race, with Spain's Efren Vazquez taking his maiden victory.
Miller entered Sunday's race atop the overall standings having won four races this season, but had to play second fiddle to the battle up front between Vazquez and Italy's Romano Fenati.
Vazquez, riding for Honda, zoomed past Fenati in the home stretch to finish in 39min 12.977sec, just ahead of Fenati, who clocked 39min 13.042sec.
Miller came home in a time of 39min 13.196sec.
-AAP