Harden made 1 of 2 free throws before Trey Burke made a 3-pointer to get the Mavericks within 3 with about 15 seconds left in OT. Harden made 1 of 2 free throws after that, Burke missed a 3, and Harden got the rebound to secure the victory.
''Our confidence defensively was building, especially in that fourth quarter,'' Harden said. ''We kept pushing the tempo, kept fighting.''
In regulation, Dallas led by 3 before Harden made the first of two free throws, and Robert Covington tipped in a miss on the second to tie it with 3.3 seconds remaining.
Harden raved about Covington's tip-in.
''Unbelievable play,'' he said. ''I didn't mean to miss it, I intended to make it. It was just a perfect miss.''
Luka Doncic missed a shot at the buzzer to send it to overtime.
Kristaps Porzingis had 39 points and 16 rebounds for Dallas, and Doncic had a triple-double with 28 points 13 rebounds and 10 assists.
Porzingis put the Mavericks up four early in overtime. Houston scored the next eight points, with the last five from Harden, to take a 147-143 lead.
Porzingis had a three-point play, but Covington added a 3-pointer after missing his first eight to extend Houston's lead to four.
''This is a tough loss,'' Dallas coach Rick Carlisle said. ''This is about as tough as it gets, and it just comes down to basic execution.''
Doncic hopes this game can be a lesson to the Mavericks.
''We're a young team. We've got a lot to learn,'' he said. ''We'll get better for sure. I know we're going to get together when it matters most, so I'm not worried about that.''
Harden, who had 23 points in the first quarter, passed Calvin Murphy to become the second-leading scorer in franchise history behind Hakeem Olajuwon.
Harden made two free throws with a minute left in the fourth to cut the lead to four, but but Maxi Kleber made a 3-pointer on the other end to extend the lead to 138-131.
Harden cut the lead again seconds later with a 3-pointer with 40 seconds to go.
Covington got the Rockets within two points with two free throws. The Rockets were forced to foul, and Seth Curry made 1 of 2 free throws to leave Dallas up 139-136 with 5.2 seconds to go.
Russell Westbrook added 31 points for the Rockets after arriving to Florida late after testing positive for the coronavirus.
''It's tough,'' he said. ''To be at home for 18, 19 days no working out ... (I) was a little slow tonight but I'll definitely be better moving forward.''
The teams combined for the most first-half points in the NBA this season, with Dallas leading 85-75 to tie its franchise record.
The Rockets went on a 7-0 run, with four points from Westbrook, to trim the deficit late in the third quarter. But Dallas wrapped up the third with a 6-2 run to lead 119-108 entering the fourth quarter.
Rockets: G Eric Gordon sat out with a sprained left ankle and is expected to be out for about 10 days. ... McLemore fouled out with about 10 minutes left.
Mavericks: Burke scored 31 points off the bench and made eight of 10 3-pointers. ... Dorian Finney-Smith fouled out late in the fourth quarter.
Rockets: Play the Milwaukee Bucks Sunday.
Mavericks: Play the Phoenix Suns Sunday.
More AP NBA: https://apnews.com/NBA and https://twitter.com/AP-Sports