Roope Hintz, Wyatt Johnston, and Esa Lindell each scored and Thomas Harley had two assists for Dallas (22-13-1), who are 6-3-1 in the past 10 games. Casey DeSmith made 21 saves.
Jason Zucker and Beck Malenstyn each scored for Buffalo (14-20-4), who had won their past three games. Ukko-Pekka Luukkonen made 29 saves.
Johnston broke a 2-2 tie to give Dallas a 3-2 lead at 11:32 in the third period when he deflected a Thomas Harley shot from the half wall.
Hintz gave Dallas a 1-0 lead on a shot from the high slot that beat Luukkonen stick side at 9:49 of the second period.
Zucker tied it 1-1 at 10:20 when he chipped in a loose puck that was sitting in the crease after DeSmith made an initial save on a Tage Thompson tip attempt.
Robertson gave Dallas a 2-1 lead at 2:35 in the third on a shot from the slot off a turnover.
Malenstyn evened it 2-2 at 4:57 when the puck deflected off of DeSmith's skate and hit his leg before bouncing in.
Lindell scored into an empty net at 18:23 for the 4-2 final on a shot from the defensive zone goal line.