They scored all of their runs in the bottom of the seventh when Ronnie Belliard hit a pinch RBI single followed by Mark Loretta's pinch RBI double, Juan Pierre's RBI single, Matt Kemp's sacrifice fly and an RBI single by Manny Ramirez.
Pierre and Casey Blake had two hits apiece for the Dodgers, who ended their five-game losing streak.
Starter Clayton Kershaw yielded three hits in six innings with three walks and 10 strikeouts, but the winner after a scoreless seventh was reliever Hong-Chih Kuo (2-0).
Todd Helton had two of the three hits for the playoff-bound Rockies, who once faced a 15 1/2-game deficit.
The losing pitcher was Franklin Morales (3-2).
Los Angeles has won back-to-back NL West titles for the first time since 1977-78.