The Diamondbacks led 3-0 during the middle innings but the Giants forged a tie with three runs in the seventh before Arizona finally struck for the game-winner.
After Paul Goldschmidt was intentionally walked, Chavez cracked the first pitch he saw into the left-center field gap to end the game.
Brad Ziegler (8-1) pitched a 1-2-3 top of the ninth for the D-backs, who bounced back from a 1-0 loss in Friday's three-game series opener.
Jessica Simpson shares three-way kiss with friends in photo
Senate Democrats to pull all-nighter on climate change