Giants 6, Diamondbacks 5 (12 innings)
PHOENIX -- San Francisco shortstop Brandon Crawford scored an unearned run in the 12th inning and the Giants ran their winning streak to four games with a 6-5, 12-inning victory over the Arizona Diamondbacks on Friday night at Chase Field.
Crawford singled to open the 12th against Randall Delgado (4-3) and took second on a passed ball before left fielder Gregor Blanco walked with one out and right-hander Ryan Vogelsong beat out a bunt to load the bases.
Crawford scored when shortstop Cliff Pennington's throw home on center fielder Angel Pagan's grounder bounced in front of the plate.
Vogelsong (7-6) pitched the final two innings, getting the final out with runners on first and second. He was the Giants' 10th pitcher, one short of the San Francisco-era record. The game lasted five hours and 11 minutes.
Crawford, right fielder Hunter Pence, second baseman Joe Panik and third baseman Matt Duffy had three hits apiece for the Giants (47-43), who have won five of their last six.
Pence tied the score at 5 with a two-run homer to cap a three-run seventh that included catcher Buster Posey's sacrifice fly.
Aaron Hill had given Arizona a 5-2 lead with a pinch-RBI double in the sixth.
Left fielder David Peralta had three hits, including two triples, and second baseman Chris Owings had two hits, including his third home run, for Arizona (42-46), which lost its fourth straight.
Diamondbacks first baseman Paul Goldschmidt had two sacrifice flies to lift his major league-high RBI total to 72 and center fielder A.J. Pollock had two doubles.
Pollock led off the first inning with the first of his two doubles, took third on Peralta's single and scored on the first of Goldschmidt's two sacrifice flies for a 1-0 lead.
Pence singled to open the Giants' second and scored on shortstop Brandon Crawford's double to right to tie it at 1.
Pollock doubled to open the third and scored on Peralta's triple. Goldschmidt followed with a sacrifice fly for a 3-1 lead.
Peralta and Colorado's Charlie Blackmon are the only National League players with at least five triples and 40 RBIs.
Owings' third homer of the season made it 4-1 in the fourth.
Diamondbacks starter Robbie Ray threw a bases-loaded wild pitch with two outs in the fifth to make it 4-2, but he struck out Pence to end the inning.
NOTES: Arizona OF Ender Inciarte was activated from the disabled list after missing 24 games because of a strained right hamstring. Arizona placed C Jarrod Saltalamacchia (neck) on the disabled list to create room on the roster. ... The Diamondbacks gave No. 1 draft pick SS Dansby Swanson a $6.5 million signing bonus, about $2 million under the projected amount for the first overall pick in the draft. Swanson is expected to report to Class A Visalia late next week. ... Arizona RHP Jeremy Hellickson (blister) is scheduled to make his next start Tuesday, but manager Chip Hale said Hellickson is not certain to be healed by that time. ... San Francisco LHP Jeremy Affeldt pitched a scoreless inning for Triple-A Sacramento on Thursday and, after another rehab appearance over the weekend, is expected to join the Giants in San Diego next week, manager Bruce Bochy said. ... The Giants began a streak of 18 games against teams at or below .500. Tampa Bay also opened the second half with a similar schedule.