Mike Dunn (1-2) picked up the win in relief and Steve Cishek pitched the ninth for his third save of the season and 32nd in a row.
Tom Wilhelmsen (0-1) took the loss for the Mariners, who dropped their sixth straight.
In the bottom of the eighth, Christian Yelich was ruled safe at home after plate umpire Ed Hickox initially ruled him out on a force play. First baseman Justin Smoak threw home on a grounder by Garrett Jones.
Marlins manager Mike Redmond, who grew up in Kirkland, Wash., challenged the call. It was overturned after a delay of 2 minutes, 20 seconds. Replays showed Yelich slid in safely tying the game at 2.
With the bases loaded and one out, Hechavarria followed with a sacrifice fly to right field against Wilhelmsen.
Corey Hart hit his second double of the afternoon to lead off the ninth against Cishek, who struck out Nick Franklin and Michael Saunders to leave pinch-runner Brad Miller stranded at third.
Yelich led off the eighth with a double off the left field wall to extend his hitting streak to 14 games. With one out, Giancarlo Stanton and Casey McGehee drew walks to load the bases to help set up the Marlins' fourth win in their last five.
A crowd of 20,208 took in the first day game at Marlins Park with the retractable roof open. It was 78 degrees when the game began.
Seattle led 2-0 on a pair of sacrifice flies by Smoak and Dustin Ackley.
Mariners starter Brandon Maurer held the Marlins without a hit until the fifth inning when Jones reached base on an infield single.
Donovan Solano ended Maurer's outing two batters later with an RBI single to pull the Marlins to 2-1.
Maurer allowed one run, two hits, and two walks in 4 1-3 innings in his season debut.
Miami's Kevin Slowey pitched five innings allowing two runs.
The Mariners now return to Seattle for a six-game home stand. The action starts Monday when Felix Hernandez throws against the Astros.