"It was important to be ready," Guerra said. "I think overall I went in there prepared and got the right results. It went well."
After Wei-Yin Chen (4-8) pitched 5 2/3 innings of one-hit ball, Miami led 2-0 going into the ninth and handed the game off to Barraclough.
Paul DeJong and Harrison Bader opened the inning with hard-hit singles, then Yairo Munoz walked. Pinch-hitter Kolten Wong struck out looking, but Matt Carpenter drew a bases-loaded walk to make it 2-1 and end Barraclough's night.
"Carp works the walk and then you've got the guy that you want up there every night in that situation with Yadi," Cardinals interim manager Mike Shildt said.
Guerra got Molina, a career .309 hitter with the bases loaded, to bounce into a double play for his first save since Sept. 27, 2014 while with the Chicago White Sox.
"He saved (21 of 22) games for me in LA (in 2011)," Mattingly said. "I've seen him be in bases-loaded jams with nobody out and get out of them, so I know he's a guy who's not going to panic in that spot."
Barraclough had blown his last three save chances, allowing 10 runs in 2 1/3 innings.
His role could be in jeopardy.
"I think he's healthy," Mattingly said. "If he's not healthy, he's not telling us, which I don't think is the case, but it's something that obviously you're not going to sit here and make any kind of decisions quickly after a game. We just won a game and we wouldn't do anything without talking to him about it anyway."
Starlin Castro had two hits, including his ninth home run for the Marlins, who returned home after a six-game winless road trip.
Former Miami All-Star Marcell Ozuna returned for his first game at Marlins Park after being traded to St. Louis in the offseason and went 3 for 4 tying his season-high with hits in a game.
"It was good to see Marcie come home," Shildt said. "He was happy to get home. He felt good about it. He likes it here and it was good to see he was received warmly as you would expect."
Luke Weaver (6-10) allowed two runs and seven hits in six innings for St. Louis.
Castro's home run to left in the fourth gave Miami a 2-0 lead.
Ozuna beat out an infield hit in the eighth, giving Jedd Gyorko an at-bat with runners on first and second with two outs. Drew Steckenrider was able to get out of the jam as Gyorko flew out to deep center.
Ozuna was given a video tribute during the game, and he tipped his cap to acknowledge the appreciation.
"That was impressive for me," Ozuna said. "I didn't even know they were going to do that for me. I appreciated it."
CHEN STRONG AT HOME
Chen improved to 3-2 with a 1.94 ERA in nine home starts this season compared to 1-6 with a 10.27 ERA in nine road starts.
"He never looks really any different at home or the road, it's just that he's pitched so much better here and that's really the only difference," Mattingly said. "You see his work, you see his preparation, it's no different. It's not like he's serious here and then he goes on the road and he's yucking it up and not taking it serious."
Cardinals: OF Tyler O'Neill (groin) was placed on the 10-day disabled list retroactive to Aug. 4. ... RHP Adam Wainwright (elbow) is planning on throwing a bullpen session either Tuesday or Wednesday.
Marlins: RHP Sandy Alcantara (armpit) was reinstated from the 10-day disabled list and optioned to Triple-A New Orleans.
Cardinals: RHP Miles Mikolas (11-3, 2.75 ERA) is scheduled to start the second game of the series Tuesday night. Mikolas has allowed three runs or fewer in eight consecutive starts.
Marlins: RHP Pablo Lopez (2-2, 4.67) allowed one run in six innings his last start, a no-decision at Philadelphia.
More AP baseball: https://apnews.com/tag/MLBbaseball and https://twitter.com/ap-sports
Yasiel Puig's pinch-hit home run in the seventh inning against the Rockies ignited the Dodgers to victory. It was Puig's sixth homer in his past 18 at-bats. "We're going to win the West," Puig declared, "and go to the playoffs."
Pinch-hitter Yasiel Puig slugged a tiebreaking, three-run homer in the seventh inning that sent the Los Angeles Dodgers past the Colorado Rockies 5-2 on Wednesday night to increase their NL West lead to 2 1/2 games.
Oakland Athletics fans will get to see Shohei Ohtani one last time in 2018 at the same venue at which everyone saw him for the first time this season when the Los Angeles Angels close out a three-game series on Thursday afternoon.
Stephen Piscotty hit a three-run homer and matched his career high with five RBI, and the Oakland Athletics beat the Los Angeles Angels 10-0 on Wednesday night to snap a three-game losing streak.
Yasiel Puig crushes a 3-run home run to center field and gets a kiss from the Dodgers' bench coach Bob Geren.
A's right fielder Stephen Piscotty blasts one down the left-field line for his 25th home run of the year.