With the Cardinals leading, 3-2, in the seventh, Salas gave up a solo shot to left field to Marlins catcher John Buck to tie the game. With left-handed Logan Morrison on deck as a pinch-hitter, Matheny played the matchup, bringing in the left-handed Freeman from the bullpen.
Morrison lofted a 1-0 offering to right field. The pitch was supposed to be a fastball low and away, but the ball drifted back and caught the middle of the plate.
"[My thoughts are] to attack, execute pitches, of course," Freeman said. "That didn't happen. The end result was one that wasn't desired."
The ball bounced off the top of the wall, hit a railing beyond the wall and then landed back on the field. The umpires initially ruled Morrison's hit a double, but after using instant replay to review the hit, Morrison was awarded a home run that proved to be the game-winner.
"As soon as he hit it, I knew that ball hit the back of the rail," Marlins manager Ozzie Guillen said. "Thank God we have instant replay, because now it was going to be a double. That helped a lot."
It marked the second time this season the Marlins have hit back-to-back home runs, and the first time the Cardinals have surrendered two in a row.
For the second straight game, the Cardinals struck early. A day removed from plating five in the first inning against Carlos Zambrano, St. Louis scored two in the opening frame against Marlins righty Anibal Sanchez.
John Jay worked a one-out walk and Matt Holliday kept up his recent surge with a double to put men in scoring position for Carlos Beltran.
Beltran's sacrifice fly to left field made it 1-0, and David Freese's RBI double -- which extended his hit streak to seven games -- plated Holliday before Sanchez could escape the inning.
Unlike Tuesday, though, the early runs didn't hold up.
Right-hander Joe Kelly, one of Monday's heroes, cruised through the first four innings, holding the Marlins scoreless until he ran into trouble in the fifth.
Kelly gave up back-to-back walks to open the inning. That set up an RBI single by Buck to cut St. Louis' lead in half. After Sanchez bunted the runners over to second and third, Jose Reyes tied the game with a groundout to second base.
"It's pretty frustrating," Kelly said. "Four-pitch walks are never too good, but you just got to battle."
The fifth inning was the only blemish on an otherwise solid night for Kelly, who didn't factor into the decision despite registering a quality start with six innings of two-run ball in his fourth career start.
"It looked like he was pitching more today and not just relying on just stuff," Matheny said. "It looked like he was thinking. ... Joe was locating his pitches, and I think that was probably his best outing."
Tony Cruz, who started behind the plate while Yadier Molina got a day off, led off the seventh with the first home run of his career. Cruz, a South Florida native, had more than 23 friends and family members in attendance, including both of his parents, his grandparents on his mother's side and his high school coach.
Cruz's homer marked the fourth game in a row a Cardinals catcher has gone yard, and it temporarily gave St. Louis a one-run lead before Buck and Morrison spoiled the young catcher's homecoming, as well as the series finale for the Cardinals.
The Marlins added an insurance run in the eighth against Victor Marte. Matt Carpenter led off the ninth with a base hit against Heath Bell, but the Cardinals were unable to crack Miami's closer like they did in Monday's come-from-behind victory. Bell retired the next three batters to send St. Louis into the off-day on a down note.
Despite the disappointing outcome Wednesday, the Cardinals finished their three-city road trip at 6-3.
"I already went around the clubhouse and reminded the guys that it was a good road trip," Matheny said. "We got to keep that in mind, we got a lot of positive things going here. Take a day [Thursday] and come back with that same positive mentality we had coming in here."