The Stars had taken a 3-2 lead on Trevor Daley's goal with less than 7 minutes remaining in regulation and seemed on their way to the win. The Ducks pulled their goalie to add a sixth attacker and Selanne netted the equalizer on the rebound of a Saku Koivu shot in the final seconds.
Cam Fowler came in on a 2-on-1 break with Bobby Ryan and buried a wrist shot past Kari Lehtonen 1:42 into overtime, giving the Ducks a win to keep them alive in the Western Conference playoff hunt.
Lubomir Visnovsky added a goal and an assist and Corey Perry scored for Anaheim, which came into the game in a three-way tie for the eighth and final seed with Dallas and Calgary.
Ray Emery turned aside 23-of-26 shots to earn the victory.
Loui Eriksson and Alex Goligoski scored and Lehtonen ended with 22 saves for the Stars, who lost for the fourth time in five games.