Chaves produced a scintillating burst of pace on the climb up the volcano at the end of the 169km stage but was reeled in by Yates who burst clear of the pursuing group in the final two kilometres.
As the two riders reached the final few metres, a powerful Yates slowed to let Chaves, who had spent the day in the escape group, take the stage win.
Yates had begun the day in third place, 17 seconds behind race leader Rohan Dennis (BMC), who laboured on the twisty Etna climb.
“I’m really happy. I arrived here at the Giro to try to win and I’ve been trying from the start in Israel to take the Jersey," Yates said. "Today I finally realised my goal.
"I want to win this Giro, of course. From the beginning, I said that I believe we have the strongest team and I still think so. It’s not just the climbers but the guys for the flat, too. Real powerful guys.
"I think we can do a really good job in defending the jersey. Of course, it will be difficult, there are many hard stages, but I’ve confidence in the guys around me. I have the confidence to be the captain until Rome. We came here as a team and I’ll try to win.”
Groupama-FDJ rider Thibaut Pinot finished third, 26 seconds behind the leading duo in the same group as reigning champion Tom Dumoulin (Sunweb), Tour de France champion Chris Froome and UAE Team Emirates rider Fabio Aru.
Dumoulin is 16 seconds adrift of Yates in second place overall while Froome, who has been off the pace at times so far, is one minute 10 seconds back.
Chaves is third overall, 26 seconds back, ahead of Friday’s mainly flat 159km stage.
“It’s been a fantastic day for us as a team but we have to keep our feet on the ground," Chaves said. "A lot of things can still happen in the Giro with many more climbs ahead but we have something to enjoy now.
"I’ve worked very well in Colombia to prepare for the Giro. With a lot of work and a lot of love, it’s not impossible to win great races. I’ve been a bit lucky to make the breakaway with only one effort, but it’s beautiful to win here today.
"A stage win plus Maglia Rosa and Maglia Azzurra… how cool is that? When he came across, Simon Yates told me, ‘Come on, you've won the stage.’ At least that’s what I understood. It’s not only today but, if you look at our team’s results since January, we’ve done great so far.”