Updated

HOUSTON (Reuters) - The Dallas Mavericks broke open a close game in the second quarter before they almost let it slip away in a gripping 106-102 win over the Houston Rockets on Saturday.

The in-form Mavericks rode the hot hand of recently acquired Peja Stojakovic to record their 11th victory in 12 contests as they closed to within seven games of the Southwest Division-leading San Antonio Spurs.

"I was able to make some shots," Stojakovic said. "I was getting good looks, and they were falling for me. I have to keep working hard and get into great playing shape. I've been getting good looks, but tonight they were falling for me."

Dallas went on an 11-3 run early in the second quarter to wrestle the lead from Houston and finished it with a 15-6 run to take a commanding 57-44 lead at halftime.

The Mavericks carried that momentum into the third period, outscoring Houston 13-5 in the opening five minutes to stretch their advantage to a game-high 23 points.

Rockets guards Kyle Lowry and Kevin Martin then orchestrated a comeback as Houston cut the lead to three points with 2:17 remaining.

"I don't know what it is about Dallas where we feel like we have to get down 20-something points before we play," Rockets coach Rick Adelman said.

However, the home team were unable to close the gap and the Mavericks scored the next five points to regain control before German forward Dirk Nowitzki finished off with four free throws.

Stojakovic and Nowitzki each scored 22 points for the Mavericks. Lowry led all scorers with 26 and Martin added 17 for the Rockets.

(Reporting by Mike Mouat in Windsor, Ontario; Editing by John O'Brien)