Controlling the puck with Radek Dvorak, Nedved finally took a pass from his fellow Czech forward from the outside of the left faceoff circle in the slot. Spinning around, he put a backhander through the legs of San Jose goaltender Miikka Kiprusoff to snap New York's season-high losing streak.
The Rangers earned their first win since beating Columbus, 5-3, on Dec. 3.
Patrick Marleau opened the scoring on the power play with his 13th goal at 4:51 into the first period for the Sharks, but Matthew Barnaby snapped a 21-game scoring drought with 62 seconds left in the second to knot the score.
Dunham made his Rangers debut after coming over from Nashville in a trade Thursday for defenseman Tomas Kloucek, left wing Rem Murray and a minor leaguer. The deal was made after it was revealed that No. 1 goaltender Mike Richter, who suffered a concussion last month, will be out for the season.
Earlier in the day, the Rangers learned that star right wing Pavel Bure, their leading goal-scorer, will return in about four weeks from a left knee injury. It was feared that Bure also might be out for the season.