Miles' two-run double in the seventh put the Dodgers up 6-1 and Carroll added a two-run single in the ninth that extended the lead to 11-6 as Los Angeles took its first win in a four-game series at Coors Field.
Casey Blake contributed a three-run double as the Dodgers banged out a season-high 18 hits.
Los Angeles, however, had to hang on for the win in the bottom of the ninth after the Rockies scored a run and then loaded the bases with two outs. Charlie Blackmon hit a slicing liner off Javy Guerra that appeared destined for the left-field corner but Tony Gwynn Jr. made a diving grab to end the game.
Dodgers starter Ted Lilly (5-5) earned the win, allowing one run on four hits over five innings.
Colorado's Jason Hammel (3-6) was tagged with the defeat after surrendering three runs (two earned) on seven hits in a five-inning effort.
Ty Wigginton clouted a solo homer and Troy Tulowitzki added two RBI for the Rockies.