DALLAS -- The Dallas Mavericks got a measure of retribution Wednesday night with a down-to-the-wire, 112-108 victory against the Houston Rockets, the team that thumped them by 36 points just three nights earlier.
Mavs guard O.J. Mayo scored seven consecutive points during a critical stretch of the fourth quarter and Darren Collison, after nearly turning the ball over at midcourt with six seconds to play, got fouled and made two free throws to seal the victory.
For a team that has been inventive in finding ways to lose down the stretch, this time Dallas held on in a game that could have teetered in either direction.
"We played better. We had a stronger posture tonight," Mavs coach Rick Carlisle said. "We were more determined. They made runs and we knew they would make runs. The run where they took the lead with about three minutes left, that was one where the guys could have dropped their heads, but they didn't."
The loss is costly for the Rockets (33-29), who are working to solidify their playoff position. Houston is in seventh place in the Western Conference, but a half-game ahead of the Utah Jazz. The Rockets lost a full game to the hard-charging Los Angeles Lakers, who rallied from a 25-point deficit Wednesday to win at New Orleans.
After leading by two with 3:41 to go, they were quickly outscored 7-2 and couldn't recover.
"A lot of little things that didn't happen the way we wanted it to happen," said Jeremy Lin, who had 12 points and three assists but was benched for the fourth quarter in favor of rookie Patrick Beverley. "That definitely hurts us on what we're trying to do. This is something we can learn from, but not something we can build on."
After Rockets guard James Harden put Houston up 104-102 with a 3-pointer, Mayo answered with a shot-clock-beating 3-pointer for a 105-104 lead with three minutes to go. He added another jumper and then dished his career-best 12th assist to Dirk Nowitzki, who got a friendly bounce off the rim for a 109-104 lead.
Harden made it 109-108 with four consecutive free throws with just over a minute to play and then Mavs forward Shawn Marion hit one of two free throws for a two-point lead with 49.9 to go.
Harden missed badly on a contested 3, but the ball went of bounds off Mavs center Brandan Wright, giving Houston a fresh 24-second shot clock with 28.5 on the game clock. Harden dribbled the clock down and drove to the rim but missed a difficult shot with the 6-10 Wright defending.
The ball went out of bounds again and, after a lengthy replay review, it went to the Mavs with 6.4 seconds to go, setting up Collison's near-turnover with Beverley applying pressure but being called for a foul.
"We tried to get him (Harden) to the rim and tried to attack and see if we couldn't get him at least to the foul line," Rockets coach Kevin McHale said. "He's our closer and he's going to close attacking normally. He'll shoot shots, but he likes to attack."
Nowitzki and Shawn Marion led the Mavs with 22 points each. Vince Carter had 16, including two key fourth-quarter 3-pointers that regained four-point leads each time. Mayo had 13 points for the double-double and Wright had 12 points.
"I'm glad we pulled it out," Marion said. "They are an exciting team and on the floor they are a team I haven't seen in a long time. We knew we had to close it at the end."
Harden scored 16 of his game-high 28 points at the free-throw line, and Chandler Parsons had 23 points.
The Mavs (27-33) led by as many as 11 in the first half, when they shot 62.5 percent.
NOTES: Carlisle started 37-year-old point guard Mike James over regular starter Collison. ... Wright made his 12th start of the season, replacing Chris Kaman. ... The Mavs used their 20th different starting lineup this season. ... Dallas entered the night having won its past five home games against the Rockets, though its nine-game overall winning streak in the series was snapped Sunday in the Rockets' 136-103 victory. ... Lin began his NBA career with the Mavs' Las Vegas summer league team in 2010. ... Marion had two steals to pass Rod Strickland for 25th on the NBA's all-time steals list. Marion has 1,622 to Strickland's 1,620.