PHOENIX -- Nothing like a visit from the Giants to get the D-backs back on the winning track.
Left-hander Patrick Corbin was outstanding for seven innings as the D-backs beat San Francisco, 5-1, on Friday night at Chase Field.
The win snapped Arizona's five-game losing streak.
"It's just good to remember what it feels like to win," Arizona catcher Miguel Montero said. "Today was just a good feeling walking in. Let's go back tomorrow and do the same."
It was the D-backs' ninth straight win over the Giants dating back to last season. The D-backs swept a three-game series from the Giants to open this season.
"There's no explanation for it," D-backs manager Kirk Gibson said of the streak. "I hope we beat them again tomorrow, but not to keep the streak alive, but just because we try to win every night."
They would have a much easier time doing that if they got pitching performances like the one Corbin, who was making his third big league start, turned in.
In his first two starts, Corbin (2-1) felt he was giving Major League hitters too much credit and was trying to be too fine with his pitches. That caused him to fall behind more than usual, and he paid the price.
"One thing coming into today, I wanted to attack the hitters," Corbin said. "I was able to throw my fastball for a strike first pitch, got ahead and that made a lot of things easier."
Corbin allowed just one run on three hits over seven innings, with four strikeouts and no walks.
"The kid pitched well, you have to give him credit, but we've been struggling too much," Giants manager Bruce Bochy said.
The Giants jumped on the board in the first inning when Melky Cabrera hit a 2-0 offering into the left-field seats. It was one of the few mistakes Corbin would make on the night.
"I fell behind to Melky there 2-0 and left a pitch middle that he took out, but then I think after that I kind of settled down," Corbin said.
Meanwhile, the Arizona offense eventually broke through against Madison Bumgarner.
The D-backs capitalized on an error by San Francisco shortstop Brandon Crawford to score an unearned run in the third and tie the game.
In the fifth, another defensive lapse wound up hurting the Giants. Left fielder Brett Pill misplayed a two-out fly ball by Montero that allowed Willie Bloomquist to score.
"I've been striking out a lot, I'm not going to lie," said Montero, who has fanned 31 times this year. "So I got two strikes and was down 0-2 and I said, 'I'm going to die swinging, I'm not going to die just looking at strike three, so let's go for it, whatever, swing the bat.' It was just a good feeling to get that double."
Paul Goldschmidt followed with a two-run homer on an 0-2 pitch to put the D-backs up, 4-1. The homer was the first for Goldschmidt since Opening Day, when he homered in his first at-bat against San Francisco's Tim Lincecum.
Goldschmidt was asked how he was able to remain confident despite going 88 at-bats between homers.
"Because this is baseball, it happens all the time," he said. "You don't really have another choice, you've got to stay confident. Just like today was good, tomorrow could change in a hurry, so tomorrow we have to have the same attitude we had today."
One inning later, A.J. Pollock hit his first Major League homer, a solo shot, that put Arizona up, 5-1.
The rookie was so excited that he hopped a bit as he came out of the batter's box, which drew some good-natured ribbing for his teammates.
"Obviously, just excited," Pollock said. "I think I hopped there, I've never done that, just a lot of emotion. Getting the win was huge coming off the off-day and being in a rivalry like that. It was a huge win for us. Corbin did a great job of setting the tone."
Bumgarner (5-2) lost for the first time since opening weekend when the D-backs beat him, 5-4, and saw his five-start winning streak snapped.
"That team is so good at hitting mistakes, it seems like every time I mess up they make me pay for it," said Bumgarner, who has a 1.54 ERA in his starts against other National League teams this year. "The pitch to Goldschmidt, that was a pitch I wanted to throw, it was pretty impressive him hitting that. I threw it right where I wanted to throw it. I guess it wasn't a very good pitch selection."
Steve Gilbert is a reporter for MLB.com. Read his blog, Inside the D-backs, and follow him on Twitter @SteveGilbertMLB. This story was not subject to the approval of Major League Baseball or its clubs.