Updated

Paul Goldschmidt hit his first home run since his initial at-bat of the season, rookie Patrick Corbin allowed three hits over seven innings and the Arizona Diamondbacks ended a five-game losing streak by beating the San Francisco Giants 5-1 on Friday night.

A.J. Pollock added his first major league homer for the Diamondbacks. Both long balls came off Madison Bumgarner (5-2), who had won five in a row since losing his first start of the season at Arizona on April 7.

Corbin (2-1) struck out four with no walks.

Melky Cabrera homered for the Giants, who have lost nine straight to the Diamondbacks dating to last season.

The home runs by Goldschmidt and Pollock were the first allowed by a San Francisco starter in nine games.

Bumgarner gave up five runs, four earned, on seven hits in six innings. He struck out five and walked two, one intentionally.

Willie Bloomquist had a double and a single with an RBI and a run scored.

Goldschmidt had gone 88 at-bats since his last home run, which came in the first inning of the season opener against Giants ace Tim Lincecum. Goldschmidt also had a pair of infield singles on Friday, his three hits tying a career best.

Corbin, in his third start since being called up from Double-A Mobile, retired 11 in a row from the start of the third through two outs in the sixth.

With the score tied at 1, Bloomquist led off the fifth with a double. With two outs, Miguel Montero doubled over the head of left fielder Brett Pill at the wall to make it 2-1. Bumgarner ran the count against Goldschmidt to 0-2, but the big first baseman sent the next pitch into the left-field seats and Arizona led 4-1.

The Diamondbacks got another run in the sixth when Pollock, who also doubled and walked, hit Bumgarner's 1-1 pitch over the wall in left to make it 5-1.

San Francisco scored on Cabrera's two-out home run in the first.

Arizona tied it with an unearned run in the third after San Francisco shortstop Brandon Crawford booted Gerardo Parra's grounder. Pollock's double put runners on second and third, then Bloomquist singled Parra home. Justin Upton's two-out walk loaded the bases but Montero's check-swing bouncer to the pitcher ended the inning.

San Francisco has lost three of four and seven of 10.

NOTES: Arizona's nine-game winning streak over the Giants is tied for the longest active streak in the majors. Milwaukee also has beaten the Marlins nine times in a row. ... Bumgarner is 13 days younger than Corbin. Both are 22-year-old left-handers. ... Crawford committed his seventh error. ... A balk called against Bumgarner in the fourth was the first against a Giants pitcher this season. ... Upton dropped Buster Posey's fly ball in deep right field in the seventh for an error. ... Arizona is 4-0 against San Francisco this season, 11-18 against everyone else. ... The Diamondbacks won just their third home game in their last 13 tries after opening the season 4-0. ... Matt Cain (1-2, 2.38 ERA) goes for the Giants and Trevor Cahill (2-3, 3.26) takes the mound for Arizona on Saturday night in the second game of the weekend series.