With four teammates along for company in the group of 15 favourites, Sanchez capitalised on Astana's numerical advantage following the final Bannberg climb, with only George Bennett (LottoNL Jumbo) able to pursue.
The Spaniard crossed the line six seconds ahead of the Kiwi, racking up Astana's fourth victory since Michael Valgren's Amstel Gold triumph last Sunday.
"Today everything went super," Sanchez said. "The guys did a fantastic job, controlling the race and following all the attacks. Firstly, it was Davide Villella in the break, and later Miguel Angel Lopez, Pello Bilbao and Nikita Stalnov who were very attentive to all moves of the rivals.
"Today, in the final I knew I had to attack to win the stage. I did it for a few times, on the downhill and later inside the last two kilometres. The second time it worked well, and I could get a small gap, enough to win.
"I am happy with this victory since it gives me motivation and confirms I am in the right place for the Giro. Also, the whole team is strong and ready for the Giro d’Italia."
Thibaut Pinot finished fourth and holds onto the overall lead.
Earlier, the day's nine-rider break formed on the first climb after around 30 kilometres raced. A feisty Bennett attacked the pack on an uncategorised ramp before the final climb and bridged to the break. But the favourites with form to unfurl before the Giro d'Italia reeled he and the breakaway remnants back in by the top. Fabio Aru (UAE) impressed with a kick on the final climb, but Sky's Kenny Elissonde buried himself to bring Aru back for leader Chris Froome.
Froome himself tried a few digs but nothing stuck and the favourites remained largely together on the descent until Sanchez' final attack into town.