Gallardo won his third straight decision, retiring 14 straight batters in one stretch to lead the Brewers over the Phillies 2-1 Friday.
Milwaukee moved back into the NL Central lead, one game over the second-place Cubs. The Brewers had been in first place since April 21 before falling one percentage point back of Chicago on Wednesday.
"It's always better to be on top," Brewers manager Ned Yost said.
One day after a dugout altercation between Yost and two of his players, the Brewers manager hoped the skirmish will spark his struggling team, which has just five wins in its last 15 games.
"What happened yesterday happened, and I think it is going to be for the good of all of us," Yost said before Friday's game. "It just shows the desire and intensity we all have to win. Sometimes frustrations mount up a little bit and it's good to get them off your chest for everyone."
Brewers first baseman Prince Fielder, who drove in a run, said the altercation was helpful.
"I think we were able to iron some things out and (it) got the players fired up a little bit, which is always good," he said. "We won today, so it obviously helped us."
Gallardo (4-1), filling in while ace Ben Sheets is sidelined with a finger injury, allowed one run and four hits in 6 2/3 innings, struck out seven and walked one. He retired 16 of his first 17 batters before pitcher Kyle Kendrick singled in the sixth.
"He was getting the breaking ball over the plate and he was getting the ball down," Phillies manager Charlie Manuel said. "His fastball was getting down and the umpire was calling it."
Gallardo felt better as the night went on.
"In the first inning, I felt I was rushing through my delivery," he said. "After that, I was able to command the ball in and out."
Francisco Cordero struck out the side in the ninth for his 33rd save in 38 chances, completing a four-hitter. Phillies batters struck out 12 times in all.
Kendrick (5-2) gave up two runs and eight hits in seven innings, matching his career-high for innings pitched. He also pitched seven innings July 29 against Pittsburgh and July 13 against St. Louis.
"He was impressive and he kept his poise," Manuel said.
Fielder's RBI single in the first and Ryan Braun's run-scoring single in the fifth built a 2-0 lead. Braun's hit drove in Gallardo, who just beat the throw from left fielder Pat Burrell and slid under the tag of catcher Chris Coste.
"The last time I did it was at Nashville, and I got thrown out at third," Gallardo said of his sliding prowess. "This one was much better."
Burrell hit his 16th homer of the season in the seventh, chasing Gallardo. Burrell has seven home runs and 23 RBI in his last 24 games.
- Philadelphia dropped five games back of the NL East-leading New York Mets.
- 2B Craig Counsell was a late scratch from the Brewers starting lineup because he felt ill. He was replaced by Tony Graffanino.
- Friday's attendance was 39,483, breaking a streak of seven straight home sellouts for the Brewers.