The defending NBA champion Mavericks were facing the Celtics just two days after being welcomed to the White House by American President Barack Obama.
Nowitzki broke an 85-85 tie by beating Celtics defender Kevin Garnett one-on-one then driving to the basket where he was fouled under the basket by a charging Brandon Bass.
Despite hard hit from Bass, Nowitzki still managed to get his shot off as he was falling which gave the Mavericks a two-point lead.
He then made his free throw which put Dallas ahead 88-85 with five seconds remaining in the fourth quarter at the TD Garden arena. Nowitzki made all six of his free throws Wednesday as is a perfect 23 of 23 against Boston since the beginning of last season.
Jason Terry put the finishing touches on the win with a basket on the final possession.
Terry, who finished with a team-high 18 points, was one of four Dallas players to reach double figures on Wednesday.
Dallas has now won 11 of the past 16 matchups against Boston.
Guard Rajon Rondo had a game-high 24 points for the Celtics who lost their second game in a row after putting together a four-game win streak.