DENVER (AP) -- The reeling Anaheim Ducks needed something to stop their slide. A record-setting second period did the trick.
The teams combined for nine goals in the second.
''I wasn't anticipating that,'' Anaheim coach Bruce Boudreau said. ''When you're struggling and you get a win it's just like a monkey off your back and you start relaxing and start playing better.''
Jonas Hiller made 34 saves two nights after giving up three goals on five shots before being pulled.
Jamie McGinn scored two goals, and John Mitchell and Gabe Landeskog added goals for Colorado, which finished 2-2 on its homestand.
The Ducks stayed tied with San Jose in the Pacific Division. The Sharks beat the New York Islanders on Friday. Both teams have 95 points, but the Ducks have played one fewer game.
Anaheim came to Denver on the heels of a 7-2 defeat at Calgary, its worst since losing by five goals to Colorado on opening night. The Ducks stopped the slide with a franchise record for goals in a period.
''I think it was just desperation,'' Winnik said. ''We haven't been playing very good hockey and we've been down after every first period. I think we are finally just sick and tired of chasing the third period.
Five goals were scored in a span of 8:45 against goalie Semyon Varlamov, who left after Lovejoy's shot bounced off the backboards and went in off his right leg to make it 5-2 at 11:31.
''We couldn't stop the bleeding,'' Avalanche coach Patrick Roy said. ''Look at the fifth goal. It hit the backboards and goes in.''
Palmieri had given Anaheim a 3-2 lead with his 10th and 11th goals less than a minute apart. Perry scored his 36th just 1:06 later, and Lovejoy followed with his fourth.
''It was one of those things we felt the ball start to roll and just kept on going with it,'' Palmieri said.
The Avalanche played four of the top five teams in the Western Conference on this homestand and moved into second place, one point ahead of Chicago, which lost at home to Nashville on Friday night.
They missed a chance to move further ahead of Chicago after their worst period of the season.
''We just weren't good enough defensively,'' center Matt Duchene said. ''It is disappointing. This was a big game for us.''
Mitchell, who signed a three-year extension a few hours before the game, gave Colorado a 1-0 lead at 12:25 of the first period. Winnik tied it early in the second.
McGinn gave the Avalanche a 2-1 lead before the Ducks broke out their offense.
McGinn and Landeskog scored 38 seconds apart late in the second to cut the deficit to 5-4, but Anaheim's Mathieu Perreault made it 6-4 with a redirection past goalie Jean-Sebastien Giguere 30 seconds later.
Tempers were raised throughout the third period. Colorado defenseman Erik Johnson was given a match penalty for a cross-check on Perreault at 2:07, and things flared up after Nathan MacKinnon had a goal disallowed because of a high stick.
Players from both teams pushed and shoved in front of the benches, and after things settled down Avalanche enforcer Patrick Bordeleau reached across the partition between the benches to push Anaheim's Patrick Maroon.
Both players were ejected.
It was reminiscent of opening night when Roy took exception to a hit on MacKinnon late in the Avalanche's 6-1 win. He slammed the glass between the benches while shouting at Boudreau.
Roy was fined $10,000 by the NHL for his actions.
''I learned my lesson,'' Roy said. ''I was quiet.''
NOTES: The Avalanche signed Mitchell to a three-year extension and G Reto Berra to a three-year contract. Both deals run through the 2016-17 season. ... Lovejoy returned to the lineup after missing Wednesday's game with the flu. ... Colorado C Paul Stastny missed his third straight game because of a back injury. He is day-to-day. ... Anaheim D Cam Fowler sustained a lower-body injury in the second period and didn't return.