DALLAS (AP) — Jason Terry’s bid to become Sixth Man of the Year is off to quite a start.

Asked to provide instant offense from the bench this season, Terry did so Monday night, scoring 31 points and guiding a late 14-4 run that carried the Dallas Mavericks past the Houston Rockets 107-98.

Tracy McGrady had 35 points and eight assists, and Yao Ming had 21 points and 11 rebounds, yet the Rockets lost for the first time this season. Houston had been 3-0 under new coach Rick Adelman.

Before tipoff, Adelman said he viewed this game and the next one — Tuesday night at home against San Antonio — as true tests of his team’s progress.

Dirk Nowitzki was only 7-of-20 from the field and had 19 points, but that included a 3-pointer that bounced in off the front rim for a big emotional boost during the gamebreaking run. He also had nine rebounds.

Josh Howard had 21 points and DeSagana Diop added 10 points, 13 rebounds and four blocks for Dallas. Jerry Stackhouse scored 16 points on his 33rd birthday, including five in the final rally.

The Mavericks are 3-1, which is notable only because they were 0-4 at this point last season, with a 41-point loss to Houston mixed in. Dallas went on to win 67 games, matching the fifth-most in league history, before getting bounced in the first round of the playoffs.

Mavericks coach Avery Johnson has tweaked his system by going with Devin Harris as his point guard and making Terry his first sub. Johnson has shown his commitment to the plan by keeping Terry as his top reserve even though Harris has missed the last two games with a bruised left thigh.

Terry began taking over this game in the final minute of the third quarter, hitting a 3-pointer, a jumper over Yao and a one-arm floater in the lane on a fast break to take Dallas from down by five points to leading 77-75 going into the fourth. Then he opened the final period with a 3-pointer, giving him 10 straight points.

The lead went back and forth five times, with Dallas grabbing it for good on a three-point play by Howard. Yet the Mavs were up only 91-90 when Terry started the winning burst with two free throws. He also fed Nowitzki on two baskets and hit two more free throws to cap the spurt with Dallas leading 105-94.

The Rockets shot 42 percent, and that was boosted by hitting 50 percent in the opening quarter. They also were hurt by nobody other than McGrady and Yao cracking double digits.

McGrady, who came in as the league’s leading scorer and on Monday received the Western Conference’s first player of the week award this season, was 12-of-31. He had 28 points through three quarters, but managed only seven more with the game to be won.