Amid a group of four breakaway riders, Fraile (Dimension-Data) outsprinted former world champion Rui Costa (UAE Team Emirates) and Pierre Rolland (Cannondale-Drapac) to take his first victory in a major three-week race.
Dumoulin (Sunweb) remained 2min 23sec ahead of 2014 winner Nairo Quintana (Movistar) and 2min 38sec ahead of Bauke Mollema (Trek-Segafredo) in the overall standings.
Fraile first got into an attack with Sky rival Mikel Landa, then dropped back to a chase group, before attacking again on the last of four climbs across the Apennine Range.
"I had noted that this stage suited me very well," Fraile said. "I went on the attack early and went with Landa because we knew we could gain some ground. When they came back up to us, I marked Rui Costa because he's fast but I was even faster today."
The 161km leg began in Ponte e Ema outside Florence, the hometown of Gino Bartali, the rider who won the Tour de France in 1938 and 1948 and the Giro in 1936, 1937 and 1946.
A series of attacks meant Dumoulin's Sunweb team had to work hard to stay with the other favourites.
"We expected a really hard fight today and it was," Dumoulin said. "I can only thank my team. They did an amazing job."
After taking part in a chase group, Andrey Amador of Quintana's Movistar team and Tanel Kangert of Astana moved up to sixth and eighth overall, respectively.
"We were doing our own pace. We knew other teams would also ride behind them so we never considered giving away the Maglia Rosa. It was an amazing teamwork and we are really happy," Dumoulin said.
“The gap I have on GC gives more room to play with. My adversaries are the ones who have to make up a lot of time on me in the mountains, so the pressure is on them, not on me.
“I don’t know all the climbs, I know the Mortirolo and the Stelvio since I had a training camp in Livigno in 2015, but we have the climbs on video and I’m not scared.”
Stage 12 is a lengthy 229km leg from Forli to Reggio Emilia featuring two minor climbs and a flat finish that should set up well for sprinters.