Updated

PHOENIX (AP) — Ryan Roberts' pinch-hit RBI single in the ninth inning gave Arizona a 7-6 victory over the Colorado Rockies on Friday night and ended the Diamondbacks' 10-game losing streak.

Gerardo Parra set up Roberts' winning hit with a tying single, driving in Edwin Jackson from second. The starting pitcher came in to run after closer Manuel Corpas (1-3) hit Mark Reynolds on the left hand with a pitch, forcing the slugger from the game.

Justin Upton and Chris Young homered for the Diamondbacks, who finally got their own celebration at home plate after losing four straight in the opponents' last at-bat during an 0-9 trip. Chad Qualls (1-2) pitched a scoreless ninth for the victory.

Carlos Gonzalez, Seth Smith and Ian Stewart homered for Colorado. Corpas has blown two chances in seven save opportunities this season.

Stewart hit a tiebreaking three-run shot in the sixth to make it 6-3. The three runs were unearned after second baseman Kelly Johnson's error.

Young connected in the bottom half and Reynolds hit his second sacrifice fly of the game in the seventh to get the Diamondbacks within one.

Arizona looked headed for another heartbreaker after loading the bases with one out in the eighth and failing to score. Rafael Betancourt came on to strike out Upton and Stephen Drew to end the inning.

But after Reynolds was hit by a pitch in the ninth, Young singled to put runners at first and second. Roberts' single came on the first pitch, scoring Young from second as the Arizona dugout emptied with joy.

Gonzalez kept up his season-long success against Arizona, hitting Ian Kennedy's 0-2 pitch over the wall in center for a game-opening homer. Five of Gonzalez's eight homers have come against the Diamondbacks. He also has two doubles, a triple, four singles and 12 RBIs against Arizona this year.

The Diamondbacks' string of 31 consecutive scoreless innings ended with Upton's two-run homer in the bottom half.

NOTES: All four of Gonzalez's game-opening homers have come against Arizona, two this season. ... The Rockies swept Arizona in Colorado to start the D-backs' 0-9 trip. ... Drew is tied for the major league lead with five triples. ... Arizona pitchers struck out 14, five by Esmerling Vasquez, whose two-out balk in the ninth lost a game in Los Angeles on Monday.