Championship leader Marc Marquez could only finish fifth after a late mistake, behind Thomas Luthi and Bradley Smith.
Speed Master rider Iannone lurked within the lead pack throughout the race, then hunted down Espargaro - who had briefly escaped from his rivals - before taking first place into San Donato at the start of the final lap.
Espargaro tried his utmost but could not get back ahead of Iannone, crossing the line 0.090 seconds behind. The Pons rider had made his break with six laps to go, after grabbing the lead from Luthi (Paddock GP) in spectacular fashion - catching a wild slide into San Donato, then slipping past Luthi amid near-contact through the following Luco/Poggio Secco esses. But despite leading by a second for a spell, Espargaro was reeled in once Iannone triumphed in a protracted battle for second with Luthi.
Marquez (Monlau) led much of the early running before slipping back into the lead group and then losing momentum when he nearly lost his bike in a low-side late on. As Tech 3 rider Smith took a season-best fourth, just behind the leaders, fellow Briton Scott Redding (Marc VDS) nearly beat Marquez to fifth.
Seventh went to Italtrans' Takaaki Nakagami, who delivered one of his strongest Moto2 rides yet to lead for a while.
JIR rider Johann Zarco made it through to 10th after being demoted from third on the grid to 18th as a punishment for clashing with Espargaro in Saturday morning practice.
Retirements included fifth-place starter Alex de Angelis (Forward Racing) and former champion Toni Elias (Aspar), who both crashed without injury.