Terry came off the bench to pace the Mavs, who got 26 points from Dirk Nowitzki in their third consecutive victory and 15th win in 16 games.
The victory was Dallas' 14th in a row against Miami.
LeBron James struck for 19 points, 10 rebounds and seven assists to lead the Heat.
Dwyane Wade contributed 22 points and seven assists, but Miami faltered on defense down the stretch to absorb its first loss since Nov. 27.
Swim Week Miami Beach 2014 [PHOTOS]