Mikkel Frohlich Honore (Deceuninck-Quickstep) finished in third place on the stage.
Ganna remains 22 seconds ahead of Portugal’s Joao Almeida in the general classification with race favourite Geraint Thomas a further second back but the Italian sprinter knows he will be handing over the jersey on Monday as the climbing starts.
A five-rider breakaway of Thomas De Gendt (Lotto Soudal), Ben Gastauer (AG2R La Mondiale), Mattia Bais (Androni Giocattoli-Sidermec), Alessandro Tonelli (Bardiani-CSF-Faizane) and Etienne Van Empel (Vini Zabu-KTM) spent the day out front before being caught with 8km remaining.
With the last five kilometres all uphill it was a stage made for the puncheurs like Sagan but he was left disappointed again as his 15-month wait for a race win continued.
It was Ulissi’s seventh Giro stage win.
It proved another terrible day for the Astana team as young Russian Alexandr Vlasov abandoned with a stomach illness, robbing his teammate of a backup option to Jakob Fuglsang in the overall classification.
The previous day Astana’s Miguel Angel Lopez crashed at high speed near the end of the time trial and needed surgery.