After Bennett had taken victory on Thursday, Viviani was able to take revenge with a more straightforward bunch sprint.
However while a bunch sprint had looked inevitable for the first 179km a powerful late attack by Marco Coledan (Wilier Triestina-Selle Italia) under the flamme rouge looked like it could spoil the sprinters' party.
Coledan immediately opened a significant gap, but faded in the final 400m as Sacha Modolo (EF Education First-Drapac) led the charge from behind.
Modolo was the first to pass Coledan with 200m to go, but had Viviani tucked in his wheel with the Quick-Step Floors rider emerging just on cue to sprint clear and win his third stage of the race
How it happened
After Thursday's wet, hectic finale, man in the peloton would have been hoping for a more straightforward sprint stage on stage 13's 180km course between Ferrara and Nervesa della Battaglia.
The five man breakaway of the day duly went away without much fuss after a couple of kilometres with Markel Irizar (Trek-Segafredo), Marco Marcato (UAE Team Emirates), Andrea Vendrame (Androni-Sidermec), Alessandro Toneeli (Bardiani CSF), and Eugert Zhupa (Wilier Triestina-Selle Italia) forming the surely doomed move.
Those riders quickly opened a gap of around 3-30, which stayed pretty much the same for much of the day as Bora-Hansgrohe, working for Sam Bennett, and Quick-Step Floors, working for Elia Viviani shared the pace-setting on the front.
The intermediate sprint with 53km to go produced a modicum of action as Viviani rolled to the front of the bunch to hoover up a few points, but the fast run in to that sprint was bad news for the break as their lead was nearly halved.
With 26km to go the break fell below a minute and with the road beginning to tilt upwards a few riders were tempted to attack with Tony Martin (Katusha-Alpecin), Krists Neilands (Israel Cycling Academy), Eros Capecchi (Quick-Step Floors), and Davide Ballerini (Androni-Sidermec) opening a slender gap.
However that counter-attack was short-lived as Bora-Hansgrohe continued to work towards a bunch sprint for Bennett, while the upping in pace saw Esteban Chaves (Mitchelton-Scott) dropped from the bunch.
By the top of the climb with 20km to go the gap to the break was down to 24 seconds, but with none of the sprinters' team committing to the chase there it remained for the next five kilometres until Bahrain-Merida started to take control.
Bahrain-Merida led down the descent before Katusha-Alpecin brought the break's lead down to 15 seconds with 8.5km to go and eight seconds with seven kilometres to go.
Alex Dowsett did the last bit of work to catch the break before handing over to Tony Martin, but Katusha's effort faded as Bahrain-Merida, Quick-Step Floors, and Mitchelton-Scott all moved to the front.
However it was LottoNL-Jumbo who seized the initiative with 1,800m to go but found themselves chasing again as Marco Coledan (Wilier Triestina-Selle Italia) put in a huge attack under the flamme rouge.
Coledan immediately opened a gap but started to fade with 600m to go as Sacha Modolo (EF Education First-Drapac) opened the sprint behind with Viviani in his wheel.
Viviani almost rode into the back of Coledan as the Wilier Triestina rider sat up at 250m to go, but was able to sneak through a small gap before accelerating clear of Modolo to take his third stage win of the race.
Meanwhile Sam Bennett had been sprinting on the other side of the road, and made good progress out in the wind to come from a long way back to take second, but didn't come close to getting up to Viviani to challenge for the win.
The pink jersey of Simon Yates finished safely in the pack, with the race leader enjoying a relatively easy day ahead of Monte Zoncolan on Saturday.
Giro d'Italia 2018, stage 13: Ferrara to Nervesa della Battaglia, 180km
1. Elia Viviani (Ita) Quick-Step Floors, in 3-56-25
2. Sam Bennett (Irl) Bora-Hansgrohe
3. Danny van Poppel (Ned) LottoNL-Jumbo
4. Sacha Modolo (Ita) EF Education First-Drapac
5. Ryan Gibbons (RSA) Dimension Data
6. Jean-Pierre Drucker (Lux) BMC Racing
7. Manuel Belletti (Ita) Androni Giocattoli-Sidermec
8. Clement Venturini (Fra) AG2R La Mondiale
9. Baptiste Planckaert (Bel) Katusha-Alpecin
10. Jens Debusschere (Bel) Lotto Soudal, all at same time
General classification after stage 13
1. Simon Yates (GBr) Mitchelton-Scott, in 55-54-20
2 Tom Dumoulin (Ned) Team Sunweb, at 47s
3 Thibaut Pinot (Fra) Groupama-FDJ, at 1-04
4 Domenico Pozzovivo (Ita) Bahrain-Merida, at 1-18
5 Richard Carapaz (Ecu) Movistar, at 1-56
6 George Bennett (NZl) LottoNL-Jumbo, at 2-09
7 Rohan Dennis (Aus) BMC Racing, at 2-36
8 Pello Bilbao (Esp) Astana, at 2-54
9 Patrick Konrad (Aut) Bora-Hansgrohe, at 2-55
10 Fabio Aru (Ita) UAE Team Emirates, at 3-10
Thank you for reading 20 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1