Varlamov was given the start by Coach Patrick Roy despite the goaltender's arrest this week on charges related to an alleged domestic violence incident. Varlamov was charged with second-degree kidnapping and third-degree assault, but a Denver judge gave him permission to travel with the team.
Colorado took a 2-0 lead into the third period on goals by Stastny and Gabriel Landeskog.
Dallas finally got to Varlamov in the third with Alex Gooligoski and Tyler Seguin doing the scoring.
Stastny won it with his fourth goal of the season.
Varlamov made 27 saves in helping bring Colorado its fifth straight win. At 11-1, the Avalanche have matched the best record in franchise history through 12 games.
Kari Lehtonen gave up three goals on 29 shots.