Jordan Pacheco drove in a pair of runs for the Rockies, who broke a five-game losing streak and won for just the second time in 10 games.
Rex Brothers (6-2) earned the win in relief with 1 2/3 scoreless innings. Rockies starter Alex White allowed two runs on five hits in 5 1/3 innings.
The Cardinals took a 2-1 lead in the sixth inning on an RBI triple by Jon Jay and a run-scoring double by Carlos Beltran. The Rockies bounced back to tie it in the bottom of the sixth and then tacked on three runs in both the seventh and eighth innings.
Fernando Salas (1-4) allowed three runs in the seventh and took the loss.