"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
Twins' Miguel Sano out after cutting foot celebrating Dominican title
Twins third baseman Miguel Sano will miss at least the first week of full-squad workouts after he cut his foot while celebrating his team winning the Dominican Winter League championship.
Remembering Dodgers legend Newcombe
Tony Kornheiser and Michael Wilbon pay homage to Dodgers pitching great Don Newcombe, who died at 92.
Rob Manfred: Slow free-agent market might be 'much ado about nothing'
Hours after Manny Machado agreed to a $300 million, 10-year deal with San Diego, MLB commissioner Rob Manfred said the slow free-agent market is "a little much ado about nothing if in fact those players all sign at the end of the day."
Cardinals' Carlos Martinez shut down, to be re-evaluated March 5
Cardinals pitcher Carlos Martinez, who had an MRI this week that showed his right shoulder is structurally sound, will be shut down for two weeks and be re-evaluated March 5.
Machado deal accelerates Padres' path back to the postseason
A team spending to win? The third baseman's move to San Diego changes the prospect-packed Friars' timetable for a return to contention.
Why Manny Machado's record deal makes sense
By signing the biggest free-agent deal in sports history, both the player and the Padres knew exactly what they were doing.