MILWAUKEE -- The Pittsburgh Pirates and the Milwaukee Brewers are engaged in a battle atop the National League Central.

While Pittsburgh needs more than the three remaining games in the series to catch Milwaukee in the standings, the Pirates moved back into second place with a 4-2 win over the frontrunners on Thursday.

"Obviously, they're a much improved team," Pirates manager Jim Tracy said of the 18-10 Brewers. "They have the best record in baseball right now, but we feel our team has improved some dating back to July of a year ago. We feel, offensively, we've still got a whole lot of mountains to climb. We haven't gotten to the point offensively where we're doing things we're capable of."

Thursday applied under that description, but the Pirates benefited from a big seventh inning with the majority of the damage coming after there were two outs. Back-to-back home runs by Jose Bautista and Ronny Paulino gave the Pirates the offensive lift they needed, and left-hander Tom Gorzelanny was solid again through seven innings to earn the victory.

"Our opportunity to win tonight was a direct result of a couple great at-bats in that one inning," Tracy said. "What put that opportunity in place to happen was the job our starting pitcher did. The way things were going offensively through the first six innings, I don't know what happens if we get hit one more time and they put any more runs up."

Gorzelanny (4-1) worked seven innings and allowed two runs on six hits. The left-hander remained perfect on the road this season and has allowed three runs or less in eight straight starts away from PNC Park, dating back to July 23, 2006.

"I wouldn't say everything worked, but I kept them off balance a little bit," he said. "I had some good offspeed pitches and that was a big thing for me, I thought. I got big outs ... and it was a good day for us."

The team received a minor scare in the fifth when trainers came to examine Gorzelanny after the pitcher said he felt something "weird" in his knee.

"He said he felt something a little awkward in his knee but after he threw those few warmup pitches, it was no problem," Tracy said.

At the time, Milwaukee was nursing a 1-0 lead, created when Brewers pitcher Dave Bush doubled and scored on a Prince Fielder single in the third. Milwaukee boosted its lead to 2-0 in the sixth when Gorzelanny uncorked a wild pitch to score Bill Hall, and Pirates batters had just two hits in six innings against Bush on the other side of the plate.

Freddy Sanchez and Jason Bay conspired on back-to-back doubles leading off the seventh to get the Pirates on the board and pull within 2-1. With two outs and Bay still on second, Bautista launched a two-run shot to left to spot the Pirates a lead, and Paulino muscled one over the right-center-field wall to add another.

"It was a changeup, definitely, and he didn't throw it where he wanted to, and I was able to take advantage and take the ball out of the park," Bautista said. "It was a nice comeback late in the game. I think I did a good job laying off pitches outside the zone and swinging at strikes. It happened to be that the pitch was right there and I put good wood on it."

Pittsburgh's defense had a hand in the outcome as well, snuffing out a double-steal attempt in the third and tagging J.J. Hardy out at home, then getting another out at the plate in the sixth. Hall was at third with one out and a chopper by Kevin Mench took a big hop to Jack Wilson, who threw a strike to Paulino at home.

Gorzelanny got in on the action in the seventh, fielding a bunt by pinch-hitter Tony Gwynn, Jr. up the first-base line and diving to tag the speedy outfielder on his way by.

"I knew he was bunting and I knew if I would try to go glove, it would be a tough play," Gorzelanny said. "Luckily I did, and held onto the ball. I was a linebacker."

Salomon Torres recorded his ninth save after working the ninth. After blowing three saves in five opportunities, the Bucs' closer has locked down three straight chances.