PHOENIX (AP) -- When their ace wasn't sharp, the Arizona Diamondbacks relied on a lineup that has thrived at home this season.
Jake Lamb and Brandon Drury homered in a five-run third, and the Diamondbacks scored five times in an inning for the second consecutive night to beat the San Diego Padres 7-4 on Wednesday.
Zack Greinke labored through five innings for his eighth win. Arizona came back from a two-run deficit to win its eighth straight home game, improving to 23-8 at Chase Field.
That record ties the club's best start to a season at home, set in 1999. The winning streak is the longest for the Diamondbacks since they won eight home games in a row in July 2012.
"One of the traits of this team that I enjoy seeing is that they smell a little blood and they get an opening and they pound through that," manager Torey Lovullo said. "We can hit home runs with the best of them and that's the high side of things. But we can keep tacking on and building on innings and creating moments for us to score runs."
Yangervis Solarte homered early for the Padres, who lost their fourth straight overall.
Greinke (8-3) had to work out of a jam in the fifth after Franchy Cordero singled in Jose Pirela, who opened the inning with a pinch-hit double. The right-hander struck out Hunter Renfroe and Ryan Schimpf with two runners on.
Greinke allowed three runs and seven hits while equaling his shortest outing of the season. He struck out eight and walked one but needed 102 pitches to get through five innings.
"Started off pretty good and then got worse from there," Greinke said. "It was OK for the most part. Flat stuff got a little flatter in the last two innings. Command was still all right but my stuff just wasn't as sharp."
Luis Perdomo (0-3) took the loss after allowing all five runs in the third. He lasted four innings and gave up five hits with four walks, a strikeout and two wild pitches.
"I didn't have a lot of command with my slider, and I think that affected me a lot. It ended up hurting me," Perdomo said.
Arizona's five-run rally started with two outs, when Perdomo walked David Peralta and Paul Goldschmidt in front of Lamb. His 15th home run of the season gave him the major league lead with 53 RBIs.
Two batters later, Drury homered to center field for his fifth of the year.
"It's kind of one of those games where … it's kind of slow moving. Those are the tough ones," Lamb said. "You've got to stay with it and we had that big inning."
The Diamondbacks went back up by three when Peralta hustled home on a wild pitch after a double steal in the seventh. Chris Owings hit a sacrifice fly to make it 7-3.
Fernando Rodney pitched the ninth for his 15th save after a scoreless inning by Archie Bradley that included two strikeouts.
Pirela, called up Tuesday from Triple-A, finished 3 for 3 after his eighth-inning RBI single.
"If you are going to have to put up a touchdown to win, you are probably not going to win a lot of baseball games," Padres manager Andy Green said.
HOMERS AT HOME
Arizona has gone deep in 11 straight home games, with 22 home runs during that span. The team last accomplished the feat in 2001, the year the Diamondbacks won their only World Series title.
Goldschmidt has reached base safely in a career-high 34 consecutive home games. He's three games shy of Stephen Drew's club record.
Padres: RHP Jered Weaver (left hip inflammation) threw a bullpen Tuesday. He's missed 16 games while on the disabled list. … RHP Carter Capps, recovering from major elbow surgery, will get back on the mound in the next day or two, Green said.
Diamondbacks: RHP Taijuan Walker threw four-plus innings and 64 pitches in an extended spring training game. He is coming back from a blister on his right index finger. … C Chris Herrmann, who left Tuesday's game with right hand soreness, was rested but seems likely to avoid the disabled list.
Padres: LHP Clayton Richard (4-6) will face Arizona on Thursday afternoon, his fourth outing against the Diamondbacks this season. Richard threw a complete game against Arizona on May 21.
Diamondbacks: LHP Patrick Corbin (4-6) takes a four-game home winning streak into his start against the Padres.