Brandon Crawford hit a game-ending RBI single, and the San Francisco Giants rallied from an early 3-0 deficit to beat the Arizona Diamondbacks 4-3.