Pierre-Edouard Bellemare and Brandon Saad also scored, and Liam O'Brien had a pair of assists for Colorado, which improved to 17-1-2 since March 10, setting a mark for the best 20-game stretch in franchise history.
''The first 40 minutes, I liked it a lot,'' Avalanche coach Jared Bednar said. ''I think we had more energy than I thought we would. I was a little bit nervous about it, guys weren't feeling well yesterday (after getting the coronavirus vaccine) and then today not being able to skate this morning, I don't think helped us, but I think the guys got a little extra rest. They put in a little extra in warm up and they came out really good.''
Devan Dubnyk made 31 saves in his Avalanche debut after being acquired from San Jose on Saturday.
''It was OK,'' Dubnyk said. ''I think a little sloppy at the start, just the rebounds siting around. Obviously, there were a few nerves for me with the new team. Got away with it and felt a little better. I settled in as the game went on.''
Mike Hoffman had two goals and an assist, Vince Dunn scored, and Jordan Binnington made 24 saves for the Blues, who had their three-game winning streak snapped.
St. Louis remained one point ahead of Arizona with two games in hand in the race for the final playoff spot in the West Division.
The Avalanche took control with a dominant second period.
Compher broke a 1-1 tie at the 2:52 mark, swatting in a rebound of an O'Brien tip that trickled through Binnington's pads. Connor Timmins, called up from the AHL prior to the game, got his first NHL point with an assist on the goal.
Rantanen's slap shot from the point found its way through traffic to make it 3-1 Avalanche at 5:17. Nathan MacKinnon got the secondary assist to extend his scoring streak to 11 games.
''We definitely grinded it out today,'' O'Brien said. ''It was kind of a good team win.''
Saad blasted a one-timer with 8:43 left in the second to give Colorado a three-goal lead.
The three-goal outburst in the second allowed the Avalanche to withstand a late comeback bid by the Blues.
Hoffman banked the puck in off Dubnyk's back to cut it to 4-2 early in the third period. Hoffman scored again on the power play with 3:16 left to cut the deficit to one.
''I think their goals, we gave them to them'' Hoffman said. ''A couple minor mistakes that they took advantage of. It's obviously a good hockey club over there. They're going to take advantage of any mistakes you make. It's tough to come back 4-1 against anyone, but especially against one of the top teams in the league.''
Bellemare gave the Avalanche a 1-0 lead midway through the first period, scoring off a drop pass from O'Brien, who won the puck in the left circle.
Dunn tied the game with a power-play goal on a tip from a Tyler Bozak feed with 4:40 left in the first. Dunn has nine points in his last 11 games.
''All three (second period) goals were mistakes,'' Blues coach Craig Berube said. ''They capitalized on them. Got to be better in the second. I thought the first period was good. Third period we were really good. But we can't give that team a 4-1 lead.''
F Carl Soderberg made his Avalanche debut after being acquired Monday from Chicago for forwards Ryder Rolston and Josh Dickinson. Soderberg played for Colorado from 2015-19.
Avalanche G Philipp Grubauer was placed on NHL's COVID-19 protocol list on Wednesday.
''It'll be more than 14 days before he's back wearing a jersey for us,'' Bednar said. ''I don't love the time off. I think when you're playing real well as a goalie, or any player, you want to keep playing games and want to stay active and stay in that groove and that's where Gruby's been for us all year.''
Blues F Brayden Schenn played in his 700th career game.
MEET ME IN ST. LOUIE
This was the first of four meetings between the Avalanche and Blues in the next 10 days. All of the games will be at Enterprise Center.
Avalanche: Host Los Angeles Kings on Friday night.
Blues: Travel to Arizona on Saturday night.
More AP NHL coverage: https://apnews.com/hub/NHL
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.