Matt Wieters also connected as St. Louis won for the ninth time in 10 games. Coupled with the Chicago Cubs' loss at Milwaukee, the Cardinals grabbed sole possession of the division lead for the first time since before play on May 7.
"I just tried to keep the same attitude even when I wasn't getting results," Goldschmidt said. "Just show up, prepare and work hard and try and go help us win the next day. That's what my mindset is now and will be tomorrow."
Goldschmidt's batting average was .254 at the All-Star break, the lowest of his nine-year career. He has five homers and 12 RBIs during his homer binge. "You find out about people when they're not going as good," St. Louis manager Mike Shildt said. "There's been moments this year when he's been uncomfortable. But he's been a complete pro. Very process oriented."
Goldschmidt's five-game run is one shy of the club record shared by Matt Carpenter and Mark McGwire. "It's the year of the homer, so it shouldn't surprise me," Houston manager A.J. Hinch said. "He's been hitting the ball out of the ballpark. It was a big swing for him. They just beat us."
Michael Brantley homered for the AL West-leading Astros, who lost for just the second time in nine games. Yuli Gurriel had two hits, extending his hitting streak to 14 games. Brantley's bases-loaded walk gave Houston a 3-2 lead in the eighth, but St. Louis went ahead to stay in the bottom half. Dexter Fowler started the rally with a leadoff walk and Jose Martinez doubled before Goldschmidt hit his team-high 23rd homer off Ryan Pressly (2-2), barely clearing the outstretched glove of a leaping George Springer in center.
Pressly was making his second appearance since taking a comebacker off a knee July 18. "He just didn't look right," Hinch said. "He didn't make his pitches like he normally goes." Andrew Miller (4-4) got one out for the win, and Carlos Martinez worked the ninth for his 10th save in 12 chances.
Wieters tied it at 2 with a solo shot in the seventh. Houston rookie Jose Urquidy gave up four hits over six innings. He struck out six and walked two. "I was focusing on each hitter," Urquidy said, "Trying to throw strikes, especially with my breaking ball."
Brantley got the Astros off to a nice start with a two-run homer off Jack Flaherty in the fourth. It was his 16th homer of the season. Flaherty gave up three hits over six innings. He struck out nine and walked one, but remained winless since May 14, covering his last 12 starts.
Fowler took a foul ball off his foot in the eighth inning. He is listed as day-to-day according to Shildt. TRAINER'S ROOM Astros: INF Carlos Correa was activated from the injured list. He has been out since late May with a fractured rib. INF/OF Tony Kemp was designated for assignment.
Cardinals: Fowler is day to day after fouling a ball off his foot in the eighth. UP NEXT Astros right-hander Gerrit Cole (11-5, 3.03 ERA) will face Cardinals right-hander Daniel Ponce de Leon (1-0, 2.82 ERA) in the second game of the three-game series Saturday. Cole leads the majors with 205 strikeouts. He is 6-0 with a 1.94 ERA since June 1. Ponce de Leon is 1-0 and has not allowed an earned in three interleague appearances, all in relief.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports