Updated

PHOENIX -- Carlos Asuaje hit a tying single and an error by left fielder David Peralta allowed the go-ahead run to score as the San Diego Padres overcame a five-run deficit in the ninth inning to beat the Arizona Diamondbacks 8-7 Saturday night.

After trailing 6-0 in the seventh inning and 7-2 in the ninth, San Diego surged ahead, sparked by Wil Myers' second two-run homer of the game.

Arizona nearly came back in the bottom of the ninth, putting runners at the corners against Brad Hand when Jake Lamb walked and J.D. Martinez singled with one out, his fourth hit.

A.J. Pollock flied out to short left, Adam Rosales loaded the bases when he was hit by a pitch and Hand struck out Ketel Marte on a 96 mph fastball that was high and outside, earning his 17th save in 22 chances.

Arizona, which began the night with a six-game lead for the NL's top wild card, lost its second straight following a team-record 13-game winning streak

Myers' homer off Andrew Chafin cut the Padres' deficit to 7-4. Fernando Rodney (4-4) relieved and struck out Cory Spangenberg, then walked Jabari Blash and threw a wild pitch. Austin Hedges hit an RBI double and scored on a single by pinch-hitter Erick Aybar, and Manuel Margot singled.

Asuaje sliced an opposite-field single to left, the fifth straight batter to reach against Rodney. Aybar scored, and when Peralta allowed the ball to bounce past him and all the way to the fence, Margot raced home.

Phil Maton (3-0) won despite allowing Peralta's RBI single in the eighth.

Diamondbacks starter Zack Godley held the San Diego Padres scoreless until the seventh inning. Godley gave up a hit leading off the game, then retired 19 of his next 20 batters -- Luis Torrens reached on a wild pitch while striking out in the sixth.

San Diego trailed 6-0 before Myers homered in the seventh. Godley allowed four hits in seven innings, striking out nine.

David Peralta had three RBIs drove in three runs out of the leadoff spot. Paul Goldschmidt went 1 for 5 with an RBI in his return after missing five games because of right elbow tightness.

Padres starter Jhoulys Chacin allowed four runs and seven hits in five innings.

Arizona built a 4-0 lead in the fifth on Peralta's two-run single and RBI singles by Goldschmidt and Martinez. Daniel Descalso homered off Miguel Diaz leading off the sixth and Chris Iannnetta hit an RBI single.

SEPTEMBER REINFORCEMENTS

Arizona recalled LHP Anthony Banda, OF Jeremy Hazelbaker and INF Ildemaro Vargas from Triple-A Reno, increasing their active roster to 34. Banda has made four starts for the Diamondbacks this season. Hazelbaker made the opening-day roster and Vargas played in two games.

MEXICAN BASEBALL HONORED

On the Diamondbacks' annual Hispanic Heritage Day, the team wore black "Los D-backs" jerseys and recognized the franchises of the Mexican Pacific League, which were represented by team mascots.

TRAINER'S ROOM

Diamondbacks: RHP Randall Delgado may miss the rest of the season with a flexor strain in his pitching arm. He felt discomfort after pitching on Wednesday. A decision on Delgado is pending evaluation of his MRI by Dr. James Andrews next week.

UP NEXT

RHP Luis Perdomo (7-9) starts Sunday for San Diego and LHP Robbie Ray (12-5) for Arizona. Ray is 3-0 with a 0.93 ERA in his last three starts, striking out 33 and walking four over 19 1/3 innings.