Wainwright, who was already named St. Louis' Opening Day starter, threw two scoreless frames. He struck out a batter and allowed a single on 25 pitches (15 strikes).
Miami backed Alvarez with three runs in the third on a trio of doubles off right-hander Lance Lynn.
With one out, Donovan Solano doubled and scored on Hechavarria's two-base hit down the third-base line. Matt Angle flied out to right before Christian Yelich walked and Giancarlo Stanton turned on the first pitch for a two-run double.
The Marlins added a pair of runs in the fourth on Jeff Mathis' one-out RBI single and Hechavarria's sacrifice fly. The rally began with one out when Jeff Baker laced a ball off the wall in right. Initially called foul, the umpires convened and awarded him a double.
Lynn, who is expected to be a member of the Cardinals' rotation, gave up five runs on six hits in 1 1/3 innings. He was initially scheduled to start Friday's game, but followed Wainwright after Thursday's game was rained out.
"I like to throw the curveball, [but] just couldn't get it in the zone against the righties," Lynn said. "Fastball was just not exactly where I wanted it."
St. Louis answered with two runs in the fourth on a pair of walks and hits against Miami lefty Brian Flynn. Matt Adams produced a one-out RBI single and Shane Robinson a two-out RBI double following consecutive free passes to Matt Carpenter and Mark Ellis.
Hechavarria knocked another sac fly in the sixth off righty Keith Butler, who went 2 1/3 innings. Adams blasted a solo shot against Miami closer Steve Cishek with one out in the sixth. Righty Eric Fornataro surrendered a run in the eighth on J.T. Realmuto's sacrifice fly to cap the scoring.
Up next: After being slowed by a groin strain, Cardinals closer Trevor Rosenthal is ready to make his spring debut, and he will do so Saturday, when the Cardinals host the Nationals in a 12:05 p.m. CT game at Roger Dean Stadium. Michael Wacha will start the game for St. Louis and should be pushed to a pitch count of about 50-55 in his second spring outing. Wacha continues to vie for a spot in the Cardinals' Opening Day rotation.
Christina De Nicola is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.