Miami has taken the first two in the series, and in the process, hung a loss on All-Star Adam Wainwright, who allowed three runs in seven innings.
Up against Wainwright, the Marlins knew runs would be scarce. Cosart was able to protect his lead, and in the process, claim his first victory since being traded to Miami from Houston on July 31.
"You know it's going to be a close game, and you figure going in that it's going to be tight," Miami manager Mike Redmond said. "That's kind of the way you play the game in your head."
It was an important start for Cosart, because he was returning to the rotation after being scratched from his Aug. 6 start at Pittsburgh due to lower back stiffness.
Any concerns about Cosart's health were quickly erased, as the right-hander was in complete control from the first inning.
"I just wanted to get through healthy," said Cosart, who won for the first time since July 7 at Texas while with the Astros. "The back feels good. Obviously, it's a huge win against a team that's in front of us in a playoff race, and against one of the best pitchers in baseball. It's a great team win."
The Marlins secured the series win over the Cardinals and improved to 4-1 on the season against them.
Miami also improved to 59-60 -- one game behind the Braves for second place in the National League East.
Cosart, A.J. Ramos, Bryan Morris and Mike Dunn combined on Miami's 13th shutout. Dunn recorded his first save of the season, and first since July 31, 2013, against the Mets. It was his fourth career save. He got the chance because Steve Cishek, who has been used heavily of late, got the night off.
Able to mix his pitches, Cosart gave the Marlins the type of performance they were hoping for when they made the trade.
"They had confidence in my ability that I could help this team," the right-hander said. "I have the utmost confidence in my own ability that I could come in here and help these guys win games and help make the playoff push. I appreciate that they had confidence in me. Now it's up to me to go out there and just keep trying to deliver quality starts."
Two of the three hits allowed by the right-hander were by Mark Ellis, the No. 8 batter. In the fifth inning, Cosart worked around his lone walk, to Oscar Taveras. Before the Cardinals could mount a threat, Cosart got Tony Cruz to tap into a 4-6-3 double play.
An error by first baseman Garrett Jones with one out and one on in the sixth inning created the only time St. Louis had two baserunners against Cosart. Again, the Miami newcomer escaped, getting Kolten Wong to tap into a fielder's choice before he struck out Matt Holliday.
"You never really know when a guy takes that many days off what you're going to get," Redmond said. "But I think the time off for him was good. He battled through there."
The game's lone runs came in the bottom of the fourth. Jarrod Saltalamacchia's RBI single to center opened the scoring. With two outs, Solano deposited a two-run homer to left field that remained just fair.
Off the bat, Solano wasn't so sure, as he didn't run until he saw the ball remain straight.
"I thought for sure that ball was going to go foul," Solano said. "I'm glad it happened like that. Wainwright is an All-Star pitcher. He's had a tremendous year, too. But when he pitched, we won tonight."
It was Solano's second homer of the season, with the other against David Price when the lefty was with the Rays. The sequence was interesting, because Cosart's approach on the night was to not swing the bat, to make sure he didn't aggravate the tight lower back he sustained on an infield single in his Miami debut on Aug. 1.
"My thought was to run one off the plate, and get him out down and away and have the pitcher coming up to start the next inning," Wainwright said. "I'm just never thinking someone's going to hit a home run off me."