ST. LOUIS -- In the big leagues primarily as a defensive replacement, Cardinals rookie outfielder Lane Thomas pounced with a chance to flex his hitting muscles.
The Cardinals rallied from an 8-4 deficit to sweep the three-game series and move into second place in the NL Central, two games behind the Chicago Cubs.
Thomas, playing his 21st game, drove in five runs. His first career slam came off Kyle Crick (3-7) and put the Cardinals ahead 9-8. He also had an RBI triple in the fourth.
"I knew he was going to throw a fastball and I just tried to get ready for it," Thomas said.
Thomas, who has been recalled from the minors four times this season, started for only the second time. Most of his other 19 appearances came as a late game defensive replacement.
"My main focus is to make sure my body feels good and that I'm ready when the opportunity comes up," Thomas said. "My role has been the defensive part of it, and I really focus on that."
St. Louis manager Mike Shildt was impressed with Thomas' all-around effort. Thomas hosed Adam Frazier at the plate with a one-hop throw from center in the first inning.
"It speaks to the kind of player that he needs to be," Shildt said. "He's going to need to be the guy that can do things like that."
Crick got two strikes on Thomas but could not put him away.
"I was going to throw a heater down," Crick said. "I think it ended up inside about thigh high and he put a pretty good swing on it."
Goldschmidt hit his team-high 26th homer in the first inning and started the five-run seventh-inning rally with a leadoff single. Marcell Ozuna followed with a single, and Crick hit back-to-back batters to set the stage for Thomas' third homer of the season.
Fowler hit a two-run homer in the eighth off Geoff Hartlieb.
"A game that encapsulates this team's toughness," Shildt said. "We have the kind of players that you win with."
Bell hit two-run homers in the first and fifth innings. It was the fifth multihomer game of his career, all this season. The homers, his 28th and 29th, were his first since July 5. He has an NL-leading 68 extra-base hits.
Pittsburgh starter Steven Brault gave up four earned runs on five hits over 4 2/3 innings. He struck out three and walked three. Brault had a seven-game hitting streak halted with an 0-for-2 performance. He came into the contest on an 8-for-10 run.
Cardinals starter Miles Mikolas surrendered five earned runs and seven hits over five innings. He gave up both home runs to Bell.
St. Louis outfielder Jose Martinez left the game in the fifth with right shoulder discomfort. He will undergo tests on Monday and is considered day-to-day.
The Pirates are 20-41 since June 1.
"At the end of the day, the game's designed to break your heart," Pittsburgh manager Clint Hurdle said. "And the game beats you up every once in a while."
The Cardinals will play 24 of their next 30 games against teams with losing records and a combined .446 winning percentage. St. Louis is 31-20 against teams with losing marks.
Pirates: C Francisco Cervelli began a rehab stint Sunday night with Double-A Altoona. Cervelli was placed on the 60-day injured list with a concussion May 26.
Cardinals: C Yadier Molina is, "very likely," to rejoin the team on Tuesday, according to Shildt. Molina has been out since July 8 with a right thumb tendon stain. He has missed the last 28 games.
Pirates: RHP Mitch Keller (0-1, 10.50) will face Los Angeles Angels LHP Jose Suarez (2-3, 6.22) in the first of a three-game set in Anaheim on Monday. Keller will be recalled from Triple-A Indianapolis on Monday. He will be making his fourth major league start.
Cardinals: RHP Jack Flaherty (5-6 3.72) will take on Kansas City RHP Glenn Sparkman (3-7, 5.71) in the first of a two-game series on Tuesday in Kansas City. Flaherty struck out 10 batters in seven innings of a 2-1 loss to the Dodgers on Wednesday.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Joc Pederson, Ross Stripling face awkward return at Dodgers camp
Joc Pederson was back in a familiar clubhouse. He had the same dressing stall and many of the same teammates.
Reds' Trevor Bauer says reaction to playoff plan criticism 'mostly positive'
Reds pitcher Trevor Bauer says he has gotten a positive response to his criticism of a plan being considered by Major League Baseball to expand the playoffs, one that includes an extended break for top seeds and some teams choosing who they will play.
Manfred hopes to have ruling for Red Sox soon
Baseball commissioner Rob Manfred wants to make sure they exhaust every piece of evidence before delivering a ruling on the Boston Red Sox, but hopes the case will wrap up in the next couple of weeks.
Ex-Dodgers pitcher Yu Darvish: Astros should be stripped of title
Yu Darvish, who was shelled in Games 3 and 7 of the 2017 World Series while with the Dodgers, says that the Astros should be stripped of their title and that players on the team shouldn't be talking right now.
Cardinals' Miles Mikolas misses bullpen session with sore elbow
St. Louis Cardinals pitcher Miles Mikolas was scratched from his second bullpen session of the spring because of a flexor tendon issue.
Brewers sign lefty Brent Suter before arbitration
The Milwaukee Brewers signed left-hander Brent Suter to a two-year contract Sunday, avoiding an arbitration hearing that was scheduled for Monday.