BOSTON (AP) The Dallas Mavericks didn't look ready at the beginning of the game.
They sure made it look easy in the final quarter.
Dirk Nowitzki scored 23 points, Wesley Matthews had 18 and the Mavericks erased an 18-point, first-half deficit to beat the Boston Celtics 106-102 on Wednesday night for their fifth straight victory.
''I thought their energy was great there in the first quarter,'' Nowitzki said of Boston's scrappy backcourt. ''They were all over us. I don't think we were ready for how intense they play. We did a great job closing it out there in the fourth. That was a fun game. Everybody was sharing the ball and making some key shots.''
Zaza Pachulia had 14 points and 12 rebounds for the Mavericks. Deron Williams added 16 points, including consecutive key baskets.
But it came down to a crucial steal to seal it.
The Celtics closed to 104-102 and had a chance to tie or take the lead, but Raymond Felton stole the ball from Isaiah Thomas in the closing seconds after Felton missed two free throws that would have secured the win.
''I've just got to be cautious of that and learn from that mistake,'' Thomas said.
Williams then nailed two free throws, making him perfect on 30 attempts this season.
''I can't say enough about the play Raymond made there at the end after missing the two free throws,'' Dallas coach Rick Carlisle said. ''He sprinted back and he got a deflection. That was the play of the game.''
Boston coach Brad Stevens knew his team wasted an opportunity.
''Well, Felton was clearly behind him, and he had it going in that direction,'' Stevens said. ''We looked like we might even have an advantage break at one point.''
Thomas led Boston with 19 points. Jared Sullinger had 18 points and 12 rebounds, and Avery Bradley scored 18 as the Celtics had their three-game winning streak snapped.
Dallas trailed 89-82 after Thomas' jumper with just under 8 minutes to play before going on a 14-2 run over the ensuing 5:04.
Williams' 3-pointer from the left corner gave the Mavericks their first lead, 94-91 with 4:18 to play. He followed with a short jumper after Boston turned the ball over with a backcourt violation.
Trailing from the game's opening basket, the Mavericks erased a nine-point halftime deficit, tying it twice in the third quarter, but Boston closed with an 11-4 spree to lead 78-70 after three. Kelly Olynyk and Bradley each had a 3-pointer from the left corner during the run.
Coming off impressive double-digit road wins at Oklahoma City and Houston, Boston opened an 18-point edge late in the opening quarter, but had it sliced to 54-45 at halftime because of Dallas' hot shooting.
The Mavericks shot 64.7 percent (11 of 17) in the second after starting the game ice cold.
Bradley scored 12 straight points in 1:43 during an 18-3 run that carried Boston to a 31-16 lead after one quarter.
Mavericks: F Charlie Villanueva left the team for the birth of his second child. ... Carlisle, president of the NBA coaches association and a teammate of fired Houston coach Kevin McHale on the Celtics' 1986 championship team, was ''extremely surprised'' that McHale was let go Wednesday. ''If you look at their team over the last few years, their roster was constantly in flux,'' Carlisle said. ''He just did an amazing job putting that thing together.''
Celtics: Stevens said he initially brought Bradley off the bench to ease his minutes because he was coming off a calf injury, but has decided to stick with that approach longer due to the team's success. ''We won and played the next night and felt pretty good about it,'' Stevens said.
Carlisle thought his team was ready for Boston's scrappy guards and up-tempo offense, but was surprised how tough it was to face.
''We were well prepared for the game and yet they still came out at us harder than expected,'' he said.
SEEING DOUBLE AGAIN
Pachulia had his sixth double-double of the season.
''He's been one of our key guys,'' Carlisle said.
Mavericks: Host Utah on Friday.
Celtics: Host Brooklyn on Friday.