Colorado won for the fifth time in six games.
The Panthers made it 3-1 on Upshall's goal at 5:18 of the third. Tomas Fleischmann swept the puck from behind the net to Upshall in the crease. Upshall pushed the puck past Varlamov's right leg and into the net for his 100th career goal.
Gilbert's slap shot with 1:43 left in the game from the point rifled past Varlamov, who was screened on the play, and made the score 3-2.
The Panthers outshot Colorado 20-6 in the final period.
Colorado stretched its lead to 3-0 in the second. O'Reilly passed from behind the net to McGinn in front and he fired it past Thomas on the stick side with 7:00 left in the period.
The Avalanche scored at 1:34 in. Matt Duchene missed a wraparound shot but O'Reilly grabbed the rebound and sneaked it past Thomas in the corner of the net to make it 1-0. The goal was O'Reilly's team-leading 19th, a new career high, and his fifth in the past six games.
Colorado took a 2-0 lead on Stastny's goal. Gabriel Landeskog passed from the left boards to Stastny in front and he backhanded it past Thomas at 16:13 of the first.
In the third period, the Panthers set a dubious franchise record of 38 power play attempts without a power play goal, dating to Nov. 10-Dec. 1, 2010. It's the league's longest drought since Vancouver went 36 straight during the 2012-13 season.
NOTES: Avalanche forward Alex Tanguay returned to the lineup after missing 36 games due to knee and hip injuries.The Avalanche played the first of three road games in four days,. They are at Tampa Bay on Saturday and Dallas on Monday. Panthers rookie Aleksander Barkov missed the game with a lower body injury suffered in Tuesday's game at Buffalo.