Italy's Baronti, a member of the Asics team, produced a final burst of speed in the final 50 metres to overtake Filippo Casagrande and Paolo Savoldelli.
Baronti completed the 107.3 miles from Verres to Borgomanero in four hours, 29 minutes, 23 seconds. The riders had to contend with rain and wind.
Gotti, trying to become the first Italian in six years to win the Giro, and chief rival Pavel Tonkov finished about a minute behind the first group. Gotti maintained his 51-second standings lead over the Russian, the 1996 champion, with seven stages left.
Gotti entered Saturday in third place, but made a daring move away from Tonkov during the second of three consecutive tough mountain climbs.
The Giro, which ends this Sunday in Milan, continues today with a relatively easy, flat stage of 98 miles from Borgomanero to Dalmine.Reuse content