SAN DIEGO -- The Colorado Rockies aren't intimidated by Petco Park's spacious outfield.
The Rockies have hit six homers in two nights at Petco, including one each game by Gonzalez.
"I can't explain that," Barmes said. "They've got some great pitching here and we've been able to find a way to score some runs and put a barrel on the ball. That's baseball. We've been without that all year, it seems like, and it's nice to actually have some guys kind of click together at the same time and kind of get some momentum offensively for our pitching."
Fans booed after Edward Mujica gave up Barmes' homer to left field on a 3-2 count with one out in the seventh. Mujica had just relieved Wade LeBlanc, who allowed Gonzalez's leadoff shot in the fourth into the sand play area beyond the right-center fence. It was the 12th for Gonzalez and the sixth for Barmes.
Barmes added an RBI single in the ninth and the Rockies won for the sixth time in eight games. Colorado committed three errors, none of which figured in the scoring.
Jason Hammel (6-3) won his fifth straight decision and Huston Street pitched a perfect ninth for his first save this season. He was activated form the disabled list a week earlier after missing the first 69 games with inflammation in his right shoulder.
The Rockies leapfrogged San Francisco into third place in the NL West, four games behind the first-place Padres.
"That's a very big game to win," manager Jim Tracy said.
Ryan Spilborghs opened the seventh with a walk and Miguel Olivo singled with one out to chase LeBlanc and bring on Mujica to face Barmes. Mujica has allowed 10 homers in 40 innings this season. He's also allowed five homers to the first batter he's faced, the most in the majors.
"The fastball has a tendency to leak out over the plate at times, the ball tends to flatten out," Padres manager Bud Black said. "He's been a big part of our bullpen. Tonight it just didn't happen. It's a long season. These guys aren't going to be invincible every night."
San Diego rallied for three runs in the bottom half to chase Hammel. Jerry Hairston Jr. hit a leadoff homer to left, his fifth. After Everth Cabrera and pinch-hitter Aaron Cunningham singled, Tracy brought in Randy Flores, who allowed Tony Gwynn Jr.'s RBI single that landed on the left-field line.
David Eckstein sacrificed before Tracy went with another left-hander, Joe Beimel, who allowed Adrian Gonzalez's RBI groundout that pulled the Padres within one. Rafael Betancourt came on and struck out Scott Hairston for the final out.
Hammel allowed three runs and seven hits in six-plus innings.
LeBlanc (4-6) matched his career high with eight strikeouts while allowing three runs and two hits in 5 1/3 innings. He walked three.
"These are big games for us," Barmes said. "It doesn't matter where it's at in the season at this point, every win's big. I think we've shown that in the last few years. It comes down to the wire for us to get into the playoffs, and we need every win we can get."
Tracy said 1B Todd Helton was doing much better, but the slugger got another game off due to lower back stiffness that led him to be scratched from Monday night's game. ... Melvin Mora had an adventuresome night filling in for Helton, diving for balls and often stretching too early for throws. "We're asking someone to do something that he's done very little of over the last several years," Tracy said. "That's something that we've got to get into the workshop and clean that up a little bit because that will make your heart pump a little bit harder than it's supposed to." ... LeBlanc set his career high in strikeouts on Oct. 3 against San Francisco. ... The Rockies recalled OF Dexter Fowler from Triple-A Colorado Springs and optioned INF Chris Nelson to the Sky Sox.