SAN FRANCISCO — Heliot Ramos hit a tying two-run double in the seventh then Jung Hoo Lee followed with a sacrifice fly that put San Francisco ahead, and the Giants rallied to beat the San Diego Padres 6-5 on Wednesday night.
San Francisco ended a stretch of 16 straight games scoring four or fewer runs.
Gavin Sheets hit a two-run triple in the first then singled in two more runs in the fifth for San Diego, which had a pair of 10-inning wins to start the four-game series.
Fernando Tatis Jr. singled to start the ninth against Ryan Walker then right fielder Daniel Johnson ran down Luis Arráez's fly to save an extra-base hit. Manny Machado followed with a single and Randy Rodríguez relieved and recorded the final two outs for his first career save.
Matt Chapman hit a two-run homer in the sixth off right-hander Nick Pivetta, who struck out five over six innings and was tagged for five runs on six hits.
Pivetta gave way to Jason Adam (5-2) after walking Willy Adames to start the seventh then allowing Daniel Johnson's single. After Patrick Bailey struck out, Tyler Fitzgerald singled to load the bases for Ramos.
Sean Hjelle (1-0) pitched 2 2/3 innings of relief for the win in his season debut after being recalled from the minors Tuesday.
Key moment