Jose Fernandez struck out a career-best 10 batters to get the victory and Steve Cishek slammed the door by retiring the Cardinals in order on nine pitches in the ninth.
Stanton went 3-for-4 and led the Miami offense, which also included an RBI double from Greg Dobbs and a run-scoring single from Fernandez. It was the third RBI in the Miami starter's rookie season.
Fernandez (4-3) became the first pitcher under the age of 21 to strike out 10 in a major league game since Seattle's Felix Hernandez did so in 2007. Fernandez allowed two runs on six hits in seven innings. Cishek earned his eighth save.
It was Miami's fourth win in six games.
Jake Westbrook (2-2) took the loss in his first appearance off the disabled list. He missed a month of action with inflammation in his right elbow. Westbrook allowed three runs on eight hits in five innings.