MILWAUKEE -- The Brewers began the season's final homestand Friday with a ballpark full of fans, an ace on the mound, and a chill in the air to go with a lingering hope for a berth in the postseason.That sense of hope is now at its limit. A 7-6 loss to the Astros at Miller Park -- marked by sloppy defense, uncharacteristically pedestrian pitching by Yovani Gallardo and shaky relief -- pushed the Brewers to the brink of elimination. Milwaukee tried a comeback in the ninth, scoring twice and putting the tying run on base, but when Norichika Aoki grounded into a game-ending double play, the Brewers saw their "tragic number" reduced to one. That means one loss over their final five games or one Cardinals win would officially end Milwaukee's valiant late-season bid for the National League's second Wild Card. "Until we're eliminated, we'll keep going at it, but we didn't play well today," manager Ron Roenicke said. "We didn't pitch well. We gave them a couple of runs in the fourth inning with the defense. We did a nice job coming back, making it interesting with the offense, but it just wasn't a well-played game." You could tell by the tone in his voice that this particular loss was particularly hurtful for the usually upbeat Brewers manager. With 41,716 rally-towel-waving fans trying to will the Brewers to the finish, Roenicke was hoping for a crisply played start to the homestand. He did not get it. "We needed to come back here and really play well, and we didn't," Roenicke said. Gallardo topped 200 innings and 200 strikeouts for the fourth straight season, and Ryan Braun's 30th stolen base gave him the 11th 40-homer, 30-steal season in Major League history, but that couldn't prevent Milwaukee from falling further behind the Cardinals, with the Dodgers in the way. The Brewers have lost five of their last seven games after winning 24 of 30 in a stretch from Aug. 20-Sept. 21 to climb within 1 1/2 games of St. Louis. When the dust has settled on the season, Thursday's ninth-inning loss in Cincinnati may be remembered as the most crushing blow. But Friday's defeat was just as deflating when you consider the Brewers had won 11 consecutive Gallardo starts dating to July 31, his first outing after the Brewers waved the white flag by trading Zack Greinke to the Angels. Gallardo helped spark a surprise turnaround by going 8-0 with a 2.75 ERA in his next 11 starts, but he was not sharp against the Astros while allowing five runs (four earned) on eight hits in six innings, with three walks and five strikeouts. "They went at us with their best pitcher," Astros interim manager Tony DeFrancesco said. "Look at [Gallardo's] numbers. That's a big-time pitcher. That's their ace, and we got him today in a big situation. They needed a win today, and we came in there and we snuck one." The teams were tied at 1 in the fourth inning, when the Brewers' defense failed Gallardo. With runners at second and third with one out, rookie shortstop Jean Segura misplayed a soft chopper for a run-scoring error, then kicked the baseball away for another error that allowed a runner to reach third. That runner -- Astros left fielder Fernando Martinez -- scored when Astros pitcher Edgar Gonzalez pushed a bunt toward first base. Corey Hart slipped, Martinez scooted home and Gonzalez was credited with an RBI single. Houston extended its lead to 5-1 in the fifth inning on back-to-back home runs by Brett Wallace and Jason Castro. Gallardo cited an inconsistent release point. He had not surrendered more than two earned runs since Sept. 2, when the Pirates got him for seven runs and 11 hits. "That's the first time I've felt like that in a while," Gallardo said. "Even the game I gave up the seven runs against the Pirates, it still felt like the command was pretty good; they were just getting hits. ... It's tough for the guys to come back from four or five runs, but they kept battling. We should be able to win when we score six runs." Braun started the Brewers' comeback with a two-run double that gave him an NL-best 112 RBIs and cut the deficit to 5-3 in the sixth inning, but the Astros increased their lead when Castro took Francisco Rodriguez deep in the eighth for his first career multi-homer game. Braun scored in the bottom of the eighth inning on Aramis Ramirez's RBI triple, but the Astros answered again in the ninth when Jose Altuve led off against Kameron Loe with a home run that made it 7-4. The Brewers refused to go down without a fight. In the bottom of the ninth against Astros closer Wilton Lopez, Logan Schafer led off with a pinch-hit single and scored on Segura's double. Segura scored on an error charged to Astros third baseman Matt Dominguez, bringing Aoki to the plate as the potential winning run. Aoki hit a bouncer to shortstop and was doubled up for only the sixth time this season. "For the most part during this streak, we've found a way to get that hit," Braun said. "Tonight, it didn't happen. It's unfortunate, obviously, because we recognize where we're at in the standings. Definitely a tough one."