Stastny fired a shot from the left circle past goalie Kari Lehtonen to beat the Stars, who had rallied from a 2-0 deficit. The goal was his fourth of the season.
"I tried to shoot through the D," Stastny said. "You don't score on these goalies unless you're flying, you make a perfect shot, or you use a screen. I tried to use a screen."
It worked and even impressed Avalanche coach Patrick Roy, a Hall of Fame goalie in his playing days.
"I think Lehtonen had no chance on that one," Roy said. "It was a perfect shot right over his shoulder."
Dallas had scored twice in the third period against Varlamov, who two days earlier spent the night in jail because of an alleged assault against his girlfriend.
A judge in Denver had ruled Thursday that Varlamov could travel with the team to Dallas. He posted a $5,000 bond, and now has a restraining order that prevents him from seeing his girlfriend.
"There's been a lot going on with him, with the team in the last 24-48 hours," Stastny said. "Sometimes the best thing is to just get in your comfort zone.
"When he's on the ice, when he's in net, he's focused on what he does."
Varlamov declined to comment on his legal issues.
"I think I am the luckiest guy in the world because I play in the NHL and I play for this team," Varlamov said. "I've got such good teammates, so I don't think about what's happening."
Stastny had made it 1-0 at 8:22 of the first period. Gabriel Landeskog doubled Colorado's lead with 1:19 left in the second.
It was more than just the start that went badly for the Stars.
"We're playing the game too slow," coach Lindy Ruff said. "Our transition is too slow. We've got to quicken things up.
"The third period was where we got some good stuff."
Dallas (5-6-2) had scored just three third-period goals in its first 12 games, and hadn't rallied in the final frame to win any of them.
The Stars outshot the Avalanche 16-8 in the third period on Friday.
Colorado (11-1) took a 1-0 lead just 8:22 into the game. Stastny put the puck in from just to the right of the net off assists from Alex Tanguay and Jan Hejda.
That goal came barely 2 minutes after Dallas turned aside the Avalanche's 5-on-3 power play.
Despite recording the final three shots of the period, the Stars were outshot 13-4.
Dallas kept pressure on Varlamov early in the second, especially during a power play midway through the period. His toughest stop was on a close-in attempt by Alex Chiasson.
"He gave us great saves," Ruff said of Lehtonen. "I thought both goaltenders came up with big saves."
The Avalanche finally broke through late when Nathan MacKinnon took the puck away in the neutral zone and passed it behind him to Landeskog.
The Avalanche captain fired a shot from the left circle across Lehtonen's body and past his glove for his fourth goal.
The Stars outshot Colorado 8-5 in the period but had nothing to show for the effort but a 2-0 deficit.
"Lehtonen was outstanding," Roy said. "I think the reason why they picked up a point is because of him. He kept them in the game long enough for them to come back in the third because it could have been a 3-, 4-, 5-0 game."
The Stars fared better in the third.
Seguin skated through the left circle, turned and passed back to Goligoski at the top of the circle. The defenseman drilled a shot into the top of the net for his second goal. Seguin's tying goal came on a blast from the top of the slot after Dallas had recovered the puck in the neutral zone.
The 25-year-old Varlamov improved to 8-1 for the Central Division-leading Avalanche.
"He made some great saves, and the two goals that we gave up, they were perfect shots," Roy said.
Stars center Ryan Garbutt served the final game of his five-game suspension for a charging penalty on Oct. 20 at Anaheim.. MacKinnon, Colorado's first-round draft pick, had two assists to take the team lead with eight.