Wainwright survived a scoreless first inning in which he faced six batters before retiring eight straight. But in the fourth, Jarrod Saltalamacchia dumped a 1-0 pitch into shallow right-center field to score Casey McGehee, who had hustled around the corner at first to lead off the frame with a double.
Two batters later, Donovan Solano did some damage against the organization that first signed him in 2005. He drove a ball down the third-base line that wavered between foul and fair territory before banging off the foul pole and into the stands for a two-run homer.
Everyone in the stadium was confused about the ball's path, including Solano, who stood and watched for a moment before it went fair.
"I'm just never thinking someone's gonna hit a home run off me," said Wainwright, who entered the game with a home run rate of 0.28 per nine innings. "And he made a good swing. That ball was 10 feet foul and it came back fair. It was just the craziest ball flight I've ever seen."
Wainwright had thrown 60 pitches by the end of that fourth inning, but he settled down enough to need just 88 total pitches to get through seven. He was at least more efficient than in his last outing on Thursday, in which he tossed 122 pitches in the same number of innings.
"Directionally today, I was very happy where I was most of the game," he said. "But we didn't win the game."
Down by three runs, St. Louis' offense couldn't put together any support for Wainwright. Marlins starter Jarred Cosart, despite a high pitch count, allowed only three hits over seven innings.
And two of those hits belonged to Mark Ellis, who was in the lineup at first base to cover for a slumping Matt Adams. The 37-year-old middle infielder didn't even seem fazed by making just his third career start at first.
"He made a nice play over there, a couple of picks," manager Mike Matheny said. "Just made the most of his day. It's great to see for him."
Ellis tried to get something started in the sixth by knocking a leadoff single. He advanced to third following an error by Marlins first baseman Garrett Jones and a forceout at second, but Matt Holliday struck out to end the threat.
The Cardinals threatened again in the ninth, like they did on Monday, but this time they were unable to score. Kolten Wong led off with a single and moved to third with two outs before Adams pinch-hit with runners on the corners. Adams, however, couldn't get to left-hander Mike Dunn, striking out for the 20th time in 22 games.
"I speak on behalf of everybody that this is not the kind of game we want to put together," Matheny said. "Waino was very good today. A couple things happened that were kind of atypical, but after that, we just can't be a team that doesn't score any runs."