The Ducks were trailing 3-1 after one period, but Perry scored 54 seconds into the middle period and added a power-play goal 11 minutes later to forge a 3-3 tie.
Emerson Etam's shorthanded tally with 1:05 left in the period put the Ducks ahead to stay.
Ryan Getzlaff provided a goal and three assists while Etam finished with a goal and an assist for the Ducks, who completed a perfect five-game homestead with a seventh consecutive win.
Teemu Selanne and Mathieu Perrault also scored for Anaheim.
Jonas Hiller started in net but was pulled after yielding three goals on 12 shots in the first period. Frederik Andersen relieved and stopped all 24 shots he faced the rest of the way.
Ryan Garbutt, Brenden Dillion and Shawn Horcoff each scored for the Stars.
Jack Campbell made 41 saves in the loss.
Yosemite climber falls 30 feet, suffers major injuries
Moore to attend retreat in to avoid Kutcher's wedding