With the win, the Ducks also set club records for wins (44) and points (100).
Chris Kunitz had two power-play goals for Anaheim, with Niedermayer assisting on the second.
Niedermayer scored his 13th goal of the season on a slap shot down the slot that sailed past goalie Marty Turco and into the top-right corner of the net.
Kunitz scored his second goal of the game to draw the Ducks even at 2-2 at 4:56 of the third period, just 3:16 after Mike Modano had given the Stars the lead.
With players from both teams scrambling for the puck in the slot, the puck popped out to Kunitz, all alone and within point-blank range of the goal. Kunitz took a brief moment to set up his shot, then knocked the puck past Turco.
The goal, which came with Mattias Norstrom off for tripping, was Kunitz’s 25th.
Modano scored on a wraparound shot for his 19th goal.
Anaheim all-star and former Norris Trophy-winning defenceman Chris Pronger was back in the lineup after missing seven games with a broken left toe. Pronger was hurt during a post-game workout on March 4.