SAN DIEGO -- It was a look of incredulity that Jake Peavy wore for most of six innings Monday, replaced only by fleeting looks of irritation that washed across his face during his start against the Arizona Diamondbacks.

That the pesky Diamondbacks were doing their part to test Peavy, his pitches as well as his patience, flicking away pitches they didn't like, laying off ones that didn't suit them, generally annoyed him to no end.

"They made me work for every out I got tonight," said Peavy, who threw a season-high 121 pitches in six innings.

In the end, though, Peavy managed a smile, especially after teammate Jody Gerut helped end the Padres' seven-game losing streak with a two-run home run in the ninth inning, as San Diego topped Arizona, 4-2, at PETCO Park.

It was just last weekend in San Francisco when general manager Kevin Towers said that Gerut, who missed the last two seasons because of knee issues, was his MVP of the year. That sentiment was shared by Peavy, among others, after the game.

And why not? Gerut, who started the season with Triple-A Portland, albeit for just one week, is hitting .292 this season with 14 home runs and 41 RBIs, including seven home runs this month. He's hitting .316 since the All-Star break.

The 30-year-old Gerut, who was mobbed by his teammates at home plate after his game-winning hit off reliever Jon Rauch -- his second long ball off Rauch in five days -- said he's had game-winning hits before, but not a walk-off home run.

"It's kind of cool," Gerut said.

At this point, 131 games into the season, Padres manager Bud Black is well past the point of being surprised with anything Gerut does at the plate. Black saw it in Spring Training, and he has seen it over and over again, especially after Gerut became a regular when the Padres finally gave up on Jim Edmonds in center field.

"There's no doubt Jody has been a key contributor since he's come back. What we saw in Spring Training was no mirage. Lately, he has been swinging the bat well. ... The ball is coming off his bat hot," Black said.

"He knows where he has been the last couple of years and is not taking it for granted."

The same could be said for Peavy on Monday, facing a team that has given him fits in the past, though the manifestation of such frustration hasn't always come by earned runs but by the way they make him expend more pitches and energy than he would like.

In that vein, Monday was certainly no different.

With the Padres leading, 1-0, going to the fourth inning, the Diamondbacks (68-63) made Peavy burn through 36 pitches, including nine during a vexing at-bat with Chris Snyder, who fouled off five pitches before lining a two-run single up the middle.

"It seemed like 20," Black said, sounding skeptical of nine. "It seemed like [Snyder] was up there 10 minutes."

The Padres (49-82) came back to tie the score in the bottom of the inning, no small feat considering Diamondbacks pitcher Dan Haren didn't allow much Monday, striking out 11 in seven innings, though he did give up nine hits.

Leadoff hitter Brian Giles, who reached base four times, knocked a two-out single to left field to drive in Josh Bard, who singled with one out in the inning.

The Padres looked like they might take the lead in the eighth inning, as they loaded the bases with one out. But Diamondbacks reliever Tony Pena wiggled free of trouble, as he got Tadahito Iguchi to hit into an inning-ending double play.

That set the stage for Gerut's heroics in the ninth inning, when he turned on the very first pitch he saw from Rauch, a slider up, for the game-winner.