The Giants scored on a D-backs error in the top of the 12th inning to pull out a 6-5 win on Friday night at Chase Field in a game that lasted 5 hours, 11 minutes.