Jake Peavy threw seven scoreless innings and Scott Hairston homered twice in the San Diego Padres' 4-2 victory over the slumping Arizona Diamondbacks on Saturday night.

Adrian Gonzalez also homered for the Padres, who have won two straight after dropping 10 of their previous 11.

Stephen Drew homered for the Diamondbacks, who lost for the fifth time in eight games to fall two games under .500 for the first time this season.

Peavy (6-5) allowed just three hits, walked two and struck out six to snap a two-game losing streak. After walking Miguel Montero with one out in the second, the reigning Cy Young Award winner retired the next 14 batters and, 17 of the final 18 hitters he faced.

Trevor Hoffman allowed Drew's one-out homer into the Padres' right-field bullpen in the ninth and a two-out single to Montero before recording his 16th save.

Arizona starter Doug Davis (3-4) was nearly as effective as Peavy, scattering seven hits over a season-high eight innings, but couldn't overcome the two pitches thrown to Hairston.

Luke Carlin led off the third inning with a single and Hairston followed one out later with a home run into the spa beyond the fence in right-center to give San Diego a 2-0 lead.

Hairston led off the sixth with his second homer, a towering fly a half-dozen rows into the left-field stands. Hairston, a one-time member of the Diamondbacks, has two two-homer games this season.

Arizona scored in the eighth when Alex Romero singled to left and Orlando Hudson hit his second double of the game into the left-field corner.

Gonzalez made it 4-1 in the ninth when he homered off Tony Pena.

Drew's homer pulled Arizona back within two in the ninth.

The Diamondbacks, who entered 13th in the NL in hitting, stranded four runners the first two innings.

Peavy opened the game with consecutive strikeouts before Hudson doubled and Conor Jackson walked. But Peavy retired Tracy on a high popup in foul territory off third base to end the inning.

In the second, Chris Young hit a one-out double and Montero walked but Davis popped up a sacrifice attempt and Peavy struck out Emilio Bonifacio.

Notes:@ Hoffman has allowed seven homers in 28 innings. ... Arizona reliever Juan Cruz left in the ninth after throwing three pitches to Adrian Gonzalez with an undetermined injury. ... Hairston also hit two homers April 29 at Philadelphia. ... Peavy snapped a two-game losing streak against Arizona and raised his career record against the Diamondbacks to 11-10. ... Hudson pulled up limping halfway between first and second on his double with an apparent right leg injury but remained in the game. ... After starting the season 17-5 against the NL West, the Diamondbacks have lost five of their last eight division games.