Corey Perry also had two goals for the Ducks, who won for the fourth time in five games and moved into a share of eighth place with Los Angeles and Minnesota in the compact Western Conference playoff race. Those three teams are two points behind Phoenix, three behind Dallas and four behind both Chicago and Calgary.
New York sits in seventh place in the East, two points in front of both Buffalo and Carolina.
Brandon Dubinsky gave the Rangers the lead 3:30 into the game but Anaheim ran off the next four goals. Visnovsky produced the second and third goals in that stretch, both coming on slap shots in the first period.
After a scoreless second period, Bobby Ryan gave Anaheim a 4-1 lead 2:19 into the third.
Perry tied it at 1-1 in the opening stanza and completed the scoring with 5:24 to play, giving him 33 goals for the season and moving him into fifth place in the NHL ahead of Sidney Crosby.
Dan Ellis picked up the win with 31 saves.
All five Anaheim goals came against Henrik Lundqvist on 33 shots.