Two errors led to two unearned runs charged to Nathan Eovaldi, and the Marlins were unable to recover. The team also was unable to complete a three-game sweep over St. Louis or return to the break-even mark for the first time since it was 53-53 on July 29.
"We didn't help ourselves out," Miami manager Mike Redmond said. "Defensively, we gave them a few extra outs there, and they took advantage. That's not us. When you start talking about playing meaningful games, you've got to make plays."
Matt Adams had a two-run single and Matt Carpenter collected three hits to give Masterson plenty of support.
Masterson limited the Marlins to three hits -- with two singles from Casey McGehee -- in seven shutout innings. The right-hander collected 12 groundouts and three strikeouts. The few hard liners Miami hit were at St. Louis defenders. Masterson didn't induce a flyout.
Redmond has history with Masterson, having previously caught him in Cleveland.
"He's a totally different guy than I caught," Redmond said. "He definitely relies on location and changing speeds, but he still gets a ton of ground balls."
Jeff Baker's pinch-hit, two-run homer in the ninth inning prevented the Marlins from being shut out for the first time since June 21 at the Mets, a span of 46 games.
The offense didn't get on track, but the game slipped away with some sloppy play, which hurt Eovaldi and ran up his pitch count. In six innings, the right-hander scattered eight hits and struck out four. He was lifted after 107 pitches.
"I felt like I didn't pick up the team," Eovaldi said. "We had a few errors. But I felt like I just didn't pick them up after that."
The Marlins had a chance to sweep the Cardinals in a three-game series for just the third time in their history. They did so at St. Louis Aug. 27-29, 1996. And the only time at home was on July 28-30, 1995.
The loss also dropped Miami two games behind Atlanta for second place in the National League East.
"We knew coming in that we were going to have our hands full with them," McGehee said. "After last night, with us being able to win the series, absolutely you want to get greedy and try to go for the sweep. But Masterson threw the ball well. He had that sinker going, getting us to hit balls on the ground."
St. Louis struck first, scoring a pair of runs in the third inning. Eovaldi had two on with two outs, and he was careful with Matt Holliday, who drew a walk. But Adams delivered a two-run single with the bases loaded.
Miami had been in control the first two games of the series, so the early lead loosened up the Cardinals' bench.
"Somebody yelled real loud, 'Hey, we got the lead,' and that was a nice change of pace," St. Louis manager Mike Matheny said. "We did need somebody to come up big for us."
The Cardinals added on in the fifth, capitalizing on Jordany Valdespin's throwing error, which brought home Carpenter with an unearned run. With runners on first and second and one out, Holliday bounced to shortstop and Miami could have gotten out of the inning unscathed. Adeiny Hechavarria flipped to Valdespin for an out, but the throw to first short-hopped Garrett Jones and deflected out of play, allowing Carpenter to score.
Another defensive miscue by Valdespin set up the second unearned run the Marlins allowed in as many innings. With two outs in the sixth, Oscar Taveras bounced to second, but the ball was booted by Valdespin. Jon Jay doubled to right, putting runners on second and third for Masterson. On a 98-mph fastball, the Cardinals pitcher slapped a single to right for his first career RBI.
"You've got the pitcher up there, and you're thinking you've got to be able to locate a fastball," Eovaldi said. "I thought I made a pretty good pitch, low and away. He just hit it."