Rantanen scored two goals, Samuel Girard and Nazem Kadri each had two assists, and Hunter Miska made 22 saves for Colorado (13-7-2), which is 4-1-1 in its past six.
"We did a real nice job the second half of the game," Avalanche coach Jared Bednar said after Colorado was without injured centers Nathan MacKinnon (head) and J.T. Compher (upper body). "Guys dug in, did a lot of good things. Guys are playing in different roles and it took us a while to find our chemistry. New lines and all that. To be fair, we were getting outworked and outskated early in the game, especially in the first period. It was really sloppy. I don't know how much outworked, but their puck movement was better than ours."
Bednar said MacKinnon, who missed his second straight game, will be on the ice Sunday. The Avalanche next play Monday at home against the Arizona Coyotes.
"He seems to be progressing and feeling better," Bednar said.
Colorado broke a third-period tie with goals 24 seconds apart from Rantanen and Brandon Saad. Rantanen scored from the point at 6:03 for a 3-2 lead, and Saad made it 4-2 at 6:27 when he redirected Andre Burakovsky's pass from the right corner.
The Ducks got within 4-3 at 13:03 on Terry's shot from above the left face-off circle and tied it 4-4 on the power play at 17:10 on Shattenkirk's shot from the point.
"You feel good to be rewarded," Anaheim coach Dallas Eakins said. "Our group should have been rewarded more through the last couple of weeks. It didn't happen, and I'm just so impressed with our guys. They weren't playing the poor-me card or [saying] the sky is falling. They kept engaged in every game. To be able to stick with it and finally get on the right side of one is a good feeling and shows resiliency pays."
Miska allowed two goals on seven shots in the third.
"I thought he was having a decent game, but when the heat got turned up and we needed a save, we didn't get it," Bednar said.