Having trailed long-time leader Bagnaia for much of the 22-lap grand prix, Di Giannantonio was flashed a ‘mapping 8’ message on his dashboard – which in the past has been a team order from Ducati.
But he overtook Bagnaia into Turn 12 on lap 19 and was handed a massive lead when Bagnaia ran off track at Turn 1 moments later trying to repass.
Settling for second, Bagnaia’s championship lead has extended from seven to 21 points as Jorge Martin struggled to a season-worst 10th on his Pramac Ducati.
VR46 Ducati rider Luca Marini completed the podium having started from pole.
Bagnaia nailed his launch from fourth on the grid on his factory team Ducati to take the holeshot into Turn 1, as Martin alongside made a terrible start, dropping to eighth.
The battle for second and third raged over the first few laps, with Di Giannantonio winning out when he came through on his Gresini team-mate Alex Marquez on the fourth tour, and then on Marini next time around.
This squabbling allowed Bagnaia to take a lead of eight tenths as Martin failed to make much progress, the Pramac rider coming under fire from Aprilia’s Maverick Vinales.
Bagnaia and Di Giannantonio eased clear of the rest of the pack, moving almost two seconds clear come lap 14 as Martin circulated in eighth.
Di Giannantonio never allowed Bagnaia to escape at the front and trailed by just two tenths at the start of lap 18.
It was on this tour that ‘mapping 8’ was shown to Di Giannantonio. But if it was a direct order from Ducati to hold position, the Italian didn’t heed this.
He threw his Gresini Ducati up the inside of Bagnaia into Turn 12 on lap 19 and kept the door shut in retaliation.
Bagnaia pulled Di Giannantonio back in along the main straight to start lap 20, but couldn’t get his bike stopped and almost ran into the back of the Gresini rider.
This sent Bagnaia off onto the run-off area and let Di Giannantonio escape by over two seconds, though the former held onto second.
Di Giannantonio has no ride for the 2024 season having been moved aside to make way for Marc Marquez at Gresini Ducati next year.
Now unlikely to get the Honda seat he had been in line for just a few weeks back, Di Giannantonio faces an uncertain future as he scored an emotional maiden MotoGP win in what could be his penultimate grand prix in the class.
Di Giannantonio ultimately took the chequered flag 2.734s clear of Bagnaia in a potentially massive day in the championship battle, as Marini finished third as the only rider in the top six to run the soft front tyre.
Vinales worked his way to fourth on the sole factory Aprilia at the chequered flag, after injured team-mate Aleix Espargaro pulled out on on lap seven.
Brad Binder was fifth on the factory KTM from Alex Marquez and Yamaha’s Fabio Quartararo, while Enea Bastianini (Ducati) and Jack Miller (KTM) relegated Martin to 10th.
Marc Marquez was 11th between the Pramac duo, with Johann Zarco 2.4s adrift. VR46’s Marco Bezzecchi, Honda’s Joan Mir and Tech3 GasGas’ Augusto Fernandez completed the top 15.
LCR Honda’s Iker Lecuona retired on lap one with a technical issue.