After surging ahead in the final few hundred metres, Visconti (Bahrain-Merida) crossed the line in second with Portugal’s José Goncalves (Katusha-Alpecin) completing the podium on the 154km stage that culminated on a two-kilometre uphill drag.
Diego Ulissi attacked from the front group of 43 riders as they went under the flamme rouge but he was quickly neutralised by Italy’s Domenico Pozzovivo.
Visconti made his bid for victory as the bunch rounded a right-hand turn into the finishing straight, but Battaglin (LottoNL-Jumbo) was quick to react and was able to sit on before sprinting past.
South Africa’s Louis Meintjes (DiData) finished safely in the leading group in 40th position and lies 29th overall, 1:15 behind.
One of the pre-race favourites, Miguel Angel Lopez (Astana), crashed within the final five kilometres and lost 43 seconds.
Four riders – Ryan Mullen (Trek-Segafredo), Laurent Didier (Trek-Segafredo), Eugert Zhupa (Wilier Triestina-Selle Italia) and Andrea Vendrame (Androni Giocattoli-Sidermec) – went clear of the peloton shortly after the start of the stage in Agrigento.
After series of attacks and counter-attacks after the last intermediate sprint, Vendrame left his breakaway companions behind with just over 20km of the day left.
He held on to a one-minute lead with 15km to go but this diminished to 20 seconds with 10km left as Simon Yates‘ Mitchelton-Scott drove the peloton in the run-in to the finish.
Stage six will take place over 164km from Caltanissetta to the finishing climb of Mount Etna.