Stanton's three-run shot highlighted a nine-run fourth inning during which he and Justin Ruggiano connected for back-to-back home runs.
Jose Reyes (4-for-5) contributed a two-run double during the big inning, when Miami had 10 hits and sent 12 men to the plate. Reyes, Carlos Lee and Donovan Solano each had a pair of hits in the frame.
John Buck went 4-for-5 with a solo homer and three runs scored for Miami, which took the opener of a four-game series.
Mark Buehrle (11-11) limited the Diamondbacks to two runs on six hits over seven innings, walking none and striking out four to earn the victory.
Diamondbacks starter Joe Saunders (6-10) was rocked for 12 hits and nine runs over 3 2/3 innings.
Jason Kubel hit a solo homer and drove in a pair of runs for Arizona.