The Mavericks had recorded just nine road victories this season and Brooklyn had lost at home only eight times, but Dallas stormed to a big lead and held on down the stretch to end a three-game skid.
Dallas opened a 14-point advantage through three periods and then scored the first six of the fourth quarter.
Carter went 7-of-12 as part of the Mavericks' 50 percent shooting performance. O.J. Mayo was the only other Dallas player in double figures with 17.
The unexpected loss slipped Brooklyn three games behind New York in the race for the Atlantic Division title.
Ray Liotta sues skin care company over use of likeness
Aaron Carter is still in love with Hilary Duff