Jake Bird (1-0) pitched 1 1/3 scoreless innings of relief for Colorado, and Pierce Johnson tossed a shutout ninth inning for his ninth save.
Brian De La Cruz had four hits and Luis Arraez had two hits for Miami, and Jacob Stallings drove in two runs.
Marlins starter Edward Cabrera (2-4) allowed three runs on five hits and one walk while striking out six in six innings
Colorado ended a three-game skid while Miami lost for the third time in four games.
The Rockies took a 2-0 lead in the first inning. With one out Profar, Kris Bryant and Diaz hit consecutive doubles, with the latter two knocking in a run apiece
The Marlins got one back in the third inning. Stallings drew a one-out walk, Garrett Hampson singled and Arraez drove in Stallings with a two-out single to make it 2-1
Miami got another run in the fourth off Chase Anderson. De La Cruz singled with one out, Jean Segura was hit by a pitch and Joey Wendle walked to load the bases. De La Cruz then scored on Stallings' grounder to third to tie the game.
The Marlins got something going in the sixth inning when De La Cruz and Wendle singled off Anderson to put runners on with two outs. Bird came on and got Stallings to line out to end the inning
Anderson allowed two runs on eight hits in 5 2/3 innings.
Colorado went back in front in the bottom of the sixth when Diaz lined a 2-1 changeup from Cabrera just over the fence in left for his fourth home run of the season.
The Rockies padded their lead in the seventh off reliever JT Chargois. Brenton Doyle led off with a walk, stole second and went to third on Ezequiel Tovar's one-out single. One out later, Profar doubled off the wall in right to bring home both runners to make it 5-2
The Marlins got a run back in the eighth when De La Cruz led off with a single, moved to second on a sacrifice bunt and scored on a two-out single by Stallings
--Field Level Media