SAN FRANCISCO -- The San Francisco Giants saw their playoff hopes die long ago this season, but they are making the most out of their unfamiliar role as spoilers.
The Giants (44-69) beat the Diamondbacks (63-48) for the second straight game and won the series 2-1 against a team that is in the thick of the wild-card chase.
"We've been through a lot," Giants manager Bruce Bochy said. "We're banged up. We brought in some young kids to get them some playing time, and yet we go out there and play some great baseball. With what we've been through, it is nice to take a series against a club that's having a very good year."
"We could've done better for sure," said Diamondbacks lefty Patrick Corbin, who took the loss Sunday. "We're definitely frustrated to come out .500, and we know we have a tough challenge coming home."
Samardzija (7-11) won his season-high third consecutive game and beat Arizona for the first time this year after back-to-back losses in his first two starts of the season. He allowed three runs on five hits, struck out three, walked three and threw 113 pitches.
"I felt pretty good," Samardzija said. "I felt they battled me pretty well. I had a good fastball today, and we used it a lot. I think they caused me to throw a lot of pitches. They battled good and stayed short, didn't strike out much. So they made me work, but overall I felt pretty good and the defense played great behind me."
Samardzija also doubled off the center-field fence and scored a run in the third inning. When he hit the ball, Samardzija thought it was going out, so he flipped the bat and started jogging to first. Then he saw the ball bounce off the fence and had to run harder for his double, drawing some laughs and jabs from his teammates.
"It just came off good, it timed up nice and I barreled it," Samardzija said. "The last time in Colorado I sprinted around the bases at a nice clip (on a home run) and ended up going out and giving up a few in the next inning. So I thought I hit it and was making sure I was just going to take it easy, and it ended up not being what I thought."
Parker, who had a walk-off single in the 10th inning of a 5-4 victory Saturday night, hit his first home run of the season in the second inning off Corbin.
Parker was reinstated from the 60-day disabled list Thursday after missing 96 games with a broken right clavicle. He was injured on April 15 against Colorado, when he slammed into the left-field fence while making a spectacular catch.
Parker made a sliding catch in foul territory Saturday. On Sunday, he threw out J.D. Martinez at home plate in the fourth inning.
"He's come up here and made some noise right away," Bochy said. "He's been impressive in the early go here."
Corbin (8-11) allowed six runs (three earned) on seven hits over six innings with 10 strikeouts and two walks.
"It felt pretty good, but that pitch to Parker, that's where he hits it," Corbin said. "That's the one pitch where I'd like to have back. Should've went slider there. Fastball in, and left the fastball middle down. He's a strong guy, and he'll (make you) pay for those."
The Diamondbacks took a 1-0 lead the first when David Peralta drew a leadoff walk and scored from third on Paul Goldschmidt's two-out double.
San Francisco answered with two runs in the second on Miguel Gomez's single and Parker's homer on a full-count fastball.
The Giants increased their lead to 4-1 in the third inning on Hunter Pence's two-run, bases-loaded single, which followed a fielding error by shortstop Ketel Marte and an intentional walk to Buster Posey.
"You can point to a number of errors, a number of reasons," Diamondbacks manager Torey Lovullo said of the loss. "We just didn't execute in a couple situations, whether it be offensively or defensively or with some pitches on the mound. That's the name of the game. It's a tough game.
"(Our) guys are built to understand that there are going to be certain challenges, and you just have to give it your best effort in the right situation. They're giving a tremendous effort."
Arizona cut the Giants' lead to 4-2 with a run in the fourth inning on Daniel Descalso's RBI single. However, with one out and runners on first and third, Marte flied out to left, and Martinez, who tagged up, was thrown out at home by Parker.
"The way he's playing left is above and beyond what I think our expectations were," Samardzija said of Parker.
The Giants scored two unearned runs in the fifth to make it 6-1 following an error by Descalso at second base during a rundown.
Following a double steal by Posey and Gorkys Hernandez, both runners came home on Nick Hundley's single up the middle.
Arizona scored a run in the seventh, but Albert Suarez came on with the bases loaded and retired A.J. Pollock on a ground ball for the third out.
Suarez blanked the Diamondbacks over the final 2 1/3 innings on one hit with three strikeouts for his first major league save. He struck out pinch hitter Chris Iannetta for the final out.
"It's big," Suarez said of his first save. "It's even better with a strikeout."
NOTES: Diamondbacks LHP Robbie Ray (concussion) will throw his first bullpen session Monday since being hit in the left side of his head by a line drive on July 28 against St. Louis. Ray, who is on the seven-day concussion disabled list, is still likely to miss a second scheduled start on Thursday against the Los Angeles Dodgers. ... Arizona's Gregor Blanco started in center field on Sunday, his first start vs. the Giants since leaving them and signing as a free agent with the Diamondbacks after the 2016 season. ... Giants INF Conor Gillaspie cleared waivers and accepted an outright assignment to Triple-A Sacramento. ... Giants SS Brandon Crawford got a rare scheduled day off, with Kelby Tomlinson starting at shortstop.