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.
"We've talked about going out there at times if there is a play that's really close, whether it is a replay game or not," Marlins manager Mike Redmond said. "Just to get used to going out there and the mechanics of [challenging]. That just seemed like a perfect time to go out and see what they saw on that play. ... It was good to get out there and ask. They were going to meet anyway. I think somebody saw it and knew that was the right call, and they got it right. I think the umpires want to get the calls right. If one of them sees it, I don't think they're afraid to overturn it. They want to get them right."
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.
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: Jacob Turner will get the start against the Braves on Saturday in Lake Buena Vista, Fla. Freddy Garcia will start for Atlanta. Marlins position players making the trip include Marcell Ozuna, Donovan Solano, Casey McGehee, Ed Lucas, Rob Brantly and Derek Dietrich.
Christina De Nicola is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.