PHOENIX -- The San Diego Padres coughed up a big lead late, costing Pedro Avila a victory in his major league debut.
That they managed to win anyway is a testament to how this surprising season has gone so far.
"You give up a five-run lead and Margot gets a big hit, just another guy coming off the bench doing huge things for us," manager Andy Green said. "That's just a great win."
Avila was impressive in his debut, scratching through a shaky first inning to allow a run and four hits while striking out five in 5 1/3 innings.
But the bullpen couldn't hold the lead.
Arizona loaded the bases against Robert Stock in the seventh, scoring two runs on David Peralta's single. Brad Wieck entered and Eduardo Escobar hit a three-run homer off the top of the left field wall to tie it 6-all.
Archie Bradley (0-1) struck out the first two batters in the eighth before Margot hit his first homer of the season out to left.
"It was one pitch that got away," Bradley said. "That is the role we're in on the back end there. You just can't let that happen."
Green didn't want to dig deep into his bullpen, but was forced to after Avila came out.
Craig Stammen (1-0) allowed a hit before closing out the seventh inning and Trey Wingenter, giving Kirby Yates a rest, walked two in the ninth before striking out Nick Ahmed for his first career save.
The Padres have won six of eight to move into first place in the NL West.
The Diamondbacks went 3 for 11 with runners in scoring position and let a chance to win slip away on one pitch out over the plate.
"I thought the way we fought back and knocked down five runs was a perfect remedy for us to win the ballgame," manager Torey Lovullo said. "Unfortunately, we didn't have that shutdown inning."
The Padres optioned left-hander Robbie Erlin to Class A Lake Elsinore, clearing room for Avila to become the third San Diego pitcher to make his big league debut in the season's first 14 games. Nick Margevicius and Chris Paddack each debuted against San Francisco.
Avila had never made an appearance above Class A before this season and made one start at Double-A Amarillo before being called up. The 22-year-old right-hander got off to a rocky start, giving up three hits and a walk in the opening inning. He escaped by allowing just one run, on Adam Jones' single, and retired the next 12 batters he faced.
Avila was lifted after hitting a batter with a pitch and walking another in the sixth.
"At the beginning I was feeling a little bit anxious, little shaken out there," Avila said through a translator. "In the end, it was a fantastic experience."
Godley gave up six runs on six hits and struck out eight in six innings.
Arizona's pitching staff has at least 10 strikeouts in four consecutive games. ... Each of the past four Padres starters making his major league debut -- including Jacob Nix last season -- has pitched at least five innings and allowed a run or less. ... Peralta was 2 for 5 and has 22 hits, a team record through 13 games. The previous mark of 21 was set by Orlando Hudson in 2007. ... Reyes has three homers in eight at-bats against Godley and is 4 for 26 against all other Arizona pitchers.
Diamondbacks: RHP Taijuan Walker will throw a bullpen Friday in his rehabilitation from Tommy John surgery.
Padres: Paddack (0-0, 1.04 ERA) has 11 strikeouts through two big league starts after splitting last season between Class A and Double-A.
Diamondbacks: RHP Luke Weaver (0-0, 6.75) will make his third start for Arizona since arriving from St. Louis as part of the Paul Goldschmidt trade. Weaver bounced back from a shaky Diamondbacks debut by allowing three runs in five innings of a 5-4 win over Boston.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Pirates, Bell take aim at Ryu's scoreless streak
There are two games left in the series between the Los Angeles Dodgers and Pittsburgh Pirates at PNC Park for the teams' attention-getting sluggers to put on a show.
Cardinals gear up for Braves rookie phenom Soroka
Here's the sort of rookie season Atlanta Braves right-hander Mike Soroka is having: He allowed one run in eight innings against the San Francisco Giants last week, and his ERA went up.
Indians look to build on momentum vs. Rays
The Cleveland Indians have been far from imposing on offense this season, but a late surge Friday proved just enough to return the club to its winning ways.
D-backs ready for Giants again after offensive onslaught
The Arizona Diamondbacks' bats came alive Friday night, when they only got a peek at their newest potential weapon.
White Sox's Banuelos returns to face slugging Twins
Chicago White Sox left-hander Manny Banuelos will return from the injured list and attempt to cool down the hot bats of the Minnesota Twins on Saturday afternoon at Target Field in Minneapolis.
Phils hope bullpen can replicate magic vs. Brewers
The Philadelphia Phillies will be looking for their third consecutive victory when they visit the Milwaukee Brewers on Saturday.