On their penultimate day in the mountains, the riders faced a brutal 166 km ride from Biella to Champoluc with five classified climbs and a total elevation gain of nearly 5,000 metres.
Decathlon AG2R La Mondiale's Prodhomme broke free on the fourth climb to take the lead and eventually the victory to become the first Frenchman to win a Giro stage this year.
As the general classification battle raged behind him, the 28-year-old emerged through a cloud of pink smoke on the home stretch, holding his helmet in disbelief as he crossed the line.
Richard Carapaz, who was second in the general classification, attacked with 6.8 kilometres left but Del Toro responded by staying glued to his wheel as they left third-placed Simon Yates behind.
But Del Toro then beat his closest rival in the sprint to the finish to take second place and remain the firm favourite for the title with two stages left after his other rivals lost 24 seconds or more.