Stephen Drew drove in Justin Upton with one out in the 12th inning, and the Arizona Diamondbacks rallied to beat the San Francisco Giants 6-5 on Sunday.