MILWAUKEE (AP) — The Houston Astros are looking ahead to next season. The Milwaukee Brewers hope they don't have to do that, too.
Edgar Gonzalez put a huge dent in the Brewers' faint playoff hopes when he allowed one hit before tiring in the sixth. Brett Wallace, Jason Castro and Jose Altuve all homered and the Houston Astros beat Yovani Gallardo for the first time in three seasons, dousing the Milwaukee Brewers' faint playoff hopes with a 7-6 victory Friday night.
"Our biggest goal was to right our ship and get the momentum going the right way into next year," Wallace said. "Part of it is trying to get as many wins as we can which is going to eliminate them."
The win helped Houston avoid matching their franchise-worst loss total set last season (56-106). It was their first victory since Bo Porter was named as the 17th manager in franchise history on Thursday. His role with Houston begins immediately following his service as the third base coach for the playoff-bound Washington Nationals.
The loss practically eliminated the Brewers from contention as Milwaukee fell five games behind St. Louis for the NL's second wild card with five games left for both teams. The Cardinals beat the Nationals 12-2.
The Brewers had won the last 11 starts overall by Gallardo (16-9), while the right-hander had beaten Houston 10 straight, since losing 2-0 at Houston on Aug. 9, 2009.
"He's a No. 1," Wallace said after Houston snapped his eight-game winning streak overall. "He's got really good stuff and he attacks you. I think sometimes you have to grind him out and hope he makes a mistake. When he does make a mistake, you have to take advantage of it. I think we just took advantage of some of the mistakes that he made and that is how you have to beat guys like that."
While the Astros took advantage of mistakes by Gallardo and relievers Francisco Rodriguez and Kameron Loe, the Brewers never challenged Gonzalez until after the fifth inning.
Gonzalez (3-1) allowed Carlos Gomez's 18th home run in the third and then nothing more until Ryan Braun's two-out, two-run double in the sixth. Gonzalez struck out three and did not walk a batter in his fifth start since the Astros purchased his contract from Triple-A Oklahoma City on Sept. 3.
"He threw the ball well," Astros manager Tony DeFrancesco said. "He had a bad hammy. You know he's a pretty good competitor. The more you watch him, the more he competes."
Wilton Lopez struggled through the ninth before picking up his ninth save.
Milwaukee scored twice to make it interesting. Jean Segura had a run-scoring double and third baseman Matt Dominguez's fielding error on a ball hit by Jonathan Lucroy allowed the final run.
"We've been really confident lately, stayed optimistic," Braun said. "We found a way to win some games late where it certainly didn't look very promising. Tonight looked and felt like it was going to be one of those games."
Wallace and Castro hit consecutive home runs in the fifth to push the lead to 5-1. Castro had the first multihomer game with a solo shot off Francisco Rodriguez in the eighth.
The Astros got one run on Matt Dominguez's single in the second and then added two more in the fourth. One run came on shortstop Segura's fielding error. Gonzalez's bunt single drove in the other run. It was his first hit and RBI in eight at-bats this season.
Gallardo missed a chance to match his career high set last season when he finished 17-10. He allowed eight hits, walked three and struck out five. He has one last opportunity when he starts Wednesday against the San Diego Padres in the season finale.
His one bright spot came in the first inning when he slipped a fastball past Jed Lowrie for a called third strike for his fourth consecutive season with 200 or more strikeouts.
Aramis Ramirez's RBI triple off Rhiner Cruz in the eighth pulled Milwaukee to 6-4. Lopez took over and struck out Corey Hart to end the threat.
NOTES: Braun, who leads the NL with 41 home runs, stole his 30th base off reliever Hector Ambriz in the sixth. It marked the second 30-30 season of Braun's career and third in franchise history. Tommy Harper did it in 1970. ... Brewers RHP Wily Peralta underwent an MRI which revealed no problem with his right biceps. He left Thursday's game against Cincinnati after 5 1-3 innings, complaining of tightness. "We didn't like what we saw the first batter he faced (in the sixth)," manager Ron Roenicke said. Peralta played catch Friday and should throw a bullpen session Saturday. ... The Brewers are 19-4 over their last 23 home games.