PHOENIX David Peralta capped a three-run rally in the bottom of the ninth inning by drawing a one-out, bases-loaded walk, giving the Arizona Diamondbacks a 4-3 win over the San Francisco Giants on Wednesday.