Joe Dombrowski (UAE Team Emirates) won a rain-soaked Stage 4 at the Giro d’Italia as the general classification was shaken up.