Brenden Morrow and Mike Ribeiro added a goal and assist each for the Stars, who shook off a 6-3 loss in New Jersey on Friday and won for the fourth time in five games.
Richard Bachman stopped 25-of-28 shots, improving to 4-1-0.
Jonas Hiller allowed all five goals on 33 shots in defeat.
Ryder's goal came with 6:42 gone, as the veteran was alone in between the circles to fire a Loui Eriksson pass by Hiller to give the Stars a 4-3 edge.
Morrow netted the lone score of the first period, less than a minute prior to the halfway point, finishing off a give-and-go with Ribeiro on a high shot from the right wing.
Alex Goligoski managed to squeeze a shot between Hiller's pads on a two-man edge just 1:19 into the second period on a power play and Ribeiro made it 3-0 for the Stars 24 seconds later.
Selanne got the Ducks on the board with a power-play tally which hit the net inside the near post from the left circle with 4 1/2 minutes gone and Visnovsky made it a one-goal deficit at 14:49 on another Anaheim advantage.
Bonino then tipped in a Cam Fowler blast with 1:33 showing and Anaheim forged a 3-3 deadlock.
Dallas has won both meetings with Anaheim this season and four of the last six dating back to November of 2010...Eriksson posted a pair of assists for the victors...Fowler totaled two assists for the visitors...The Stars host Philadelphia on Wednesday, and the Ducks continue their five-game road swing in Los Angeles on Thursday.