Jeff Baker reached on an error and Donovan Solano hit an infield single before Stanton drove a ball to right field with two outs.
Texas got on the board first against Jarred Cosart in the fourth. Adrian Beltre doubled with one out, and following a Leonys Martin single, scored on a Robinson Chirinos ground ball.
The Marlins got the run back in the bottom of the frame against Miles Mikolas, when Marcell Ozuna hit a deep home run to left center field with two outs.
Miami added a pair in the bottom of the sixth, after the inning opened with a Garrett Jones double and Ozuna single to put runners on the corners with nobody out. A Jarrod Saltalamacchia RBI single gave the Marlins a 2-1 lead, and an Adeiny Hechavarria sacrifice fly to deep center field gave the Marlins a two run edge.
In his six innings, Cosart allowed one run while walking and striking out two.
The Rangers rallied against Miami's bullpen in the seventh, as Rougned Odor hit a double off the wall against A.J. Ramos that was mishandled by Giancarlo Stanton and allowed Odor to score. Ramos loaded the bases with two outs before Mike Dunn walked Daniel Robertson to tie the game at three.
Sam Dyson and Bryan Morris pitched well in relief, and Steve Cishek escaped a jam in the ninth when Elvis Andrus was caught stealing on a failed squeeze bunt.
Hero of The Game: Giancarlo Stanton (+.431 WPA)
Goat of The Game: Casey McGehee (-.189 WPA)
Play of The Game: Giancarlo Stanton singled in the tenth, allowing Jeff Baker to score. (+.400 WPA)