Dryden Hunt had three assists, and Igor Shesterkin made 29 saves for the Rangers (37-17-5), who had lost two straight.
"It was kind of a must-win game for us, although it wasn't, it kind of was just for our mental well-being," Hunt said. "It was only two games, but it felt like a couple of weeks of just not playing our best."
Esa Lindell had a goal and an assist for the Stars (32-22-3), who have lost two in a row after winning their previous four. Jake Oettinger made 22 saves.
Lindell scored 49 seconds into the first period to give Dallas a 1-0 lead. He carried the puck nearly the length of the ice, warded off Panarin and beat Shesterkin with a soft backhand from a sharp angle.
Tyler Seguin made it 2-0 at 4:53 when he redirected a shot from Joel Kiviranta.
Greg McKegg cut it to 2-1 at 9:45 when he deflected K'Andre Miller's shot through a screened Oettinger, and Mika Zibanejad tied it 2-2 at 12:59 with a one-timer from above the right face-off circle on the power play.
"I think we gave up too many chances for them, didn't take time and space away," Lindell said. "That good team like they are, they're going to make plays and hang on to pucks and make us run around. Then it's kind of havoc out there. I would say (we had) poor defense. (We) got to better at that, can't let up that many chances and goals."
Adam Fox gave New York a 3-2 lead at 14:14 of the first when he skated to the net and deflected Jacob Trouba's shot five-hole on Oettinger.
Panarin scored 36 seconds later to extend the lead to 4-2, creating separation against Joel Hanley and shooting blocker side.
"Good game for us," Panarin said. "Tough start again, like we do always. … Just start hard and tried to win every battle."