DALLAS, May 2 (Ticker) -- The Dallas Mavericks put an end to the home-court disadvantage, but not without a little help.

Benefiting from five missed free throws from Yao Ming and some remarkable good fortune, the Mavericks held on for a 103-100 victory over the Houston Rockets and a 3-2 lead in their Western Conference first-round series.

NBA TV highlights from

Dirk Nowitzki had 23 points and 13 rebounds for the fourth-seeded Mavericks, who became the first home team to win gained tenuous control of the seesaw series. They can advance to the conference semifinals for the fourth time in five years with - what else? - a road win Thursday.

"We didn't want to go down there and steal two and come back up here and lose a home game again," Nowitzki said. "We had to protect home court. Finally we got a win on the home court. We weren't playing phenominal the first two games here and we got beat. We had to do a little extra and it worked."

Playing in front of a franchise-record home crowd of 20,894, Dallas took the lead for good with 2:39 left in the second quarter but never felt comfortable with it. It nearly squandered an 11-point lead with 4 1/2 minutes to go by using the same small lineup that has turned around the series.

"We were pretty much up all game and they kept coming back," Nowitzki said. "We were up 11 at one time right there in the fourth and ... they're a good team. They're going to make good plays. Obviously, they've got two superstars who had it going again tonight. "

A jumper by Nowitzki made it 97-91 with 1:49 to play. Tracy McGrady sank two free throws and Yao was fouled with 1:21 left. He missed his fifth straight foul shot of the period before draining one to cut the deficit to 97-94 with 1:21 remaining.

"The missed free throws are a bad thing but not really hurting us," Yao said. "We still could have kept going (toward a win) after the missed free throws. I felt really good but maybe it was because of a little bit of exhaustion."

Game Four hero Jason Terry missed a 3-pointer that was rebounded by Jon Barry, who had the ball slapped away by Michael Finley - whose feet were out of bounds. Jerry Stackhouse grabbed the loose ball and was fouled, sinking two free throws for a 99-94 lead with 56 seconds left.

"It was a crucial rebound by Jon Barry," Mc Grady said. "He had the ball smacked out of his hands, but the guy that smacked it out had two feet out of bounds. That right there is very rare, when a referee is right on a play opposed to being far. He was right there on the play and I don't understand why he didn't see it."

Yao, who scored 15 of his 30 points in the final period, had a follow dunk and two free throws around a huge follow shot by Nowitzki, leaving Houston in a 101-98 hole with 17 seconds to play.

The Mavericks inbounded to Michael Finley, who was trapped in the corner by a pair of Rockets. Although neither defender touched Finley, a foul was called.

Finley split two free throws and McGrady made a layup with 7.4 seconds left. After a timeout, Marquis Daniels threw a risky long pass into the backcourt that was nearly intercepted by Mike James, who fouled Terry with 4.8 seconds to go.

"That last play when he threw it in the backcourt to JT, that was about will," Stackhouse said. "It wasn't about X's and O's. Obviously the play that we drew up, they had everything covered. Marquis just threw the ball up. He and JT had something going. He told Marquis if he didn't have anybody in the open, throw it in the backcourt and he was going to go up and get it."

Terry split the free throws, leaving the Mavericks with a three-point lead. McGrady was fouled in the backcourt by Stackhouse and missed the first free throw. He intentionally missed the second and somehow grabbed the rebound, dribbling to the arc before firing a jumper that hit the rim as time expired.

"On the way to the locker room I saw the replay and saw that my foot was on the line," McGrady said. "I know at the end of a game like that the officials would have to review it. It would have been heartbreaking to have made it and it only counted for two."

Stackhouse and Josh Howard scored 17 points apiece for the Mavericks, who had six players in double figures.

"To win this game, the whole team had to come through," Nowitzki said. "We had six guys in double figures, so I think we did that."

McGrady scored 25 points but made just 7-of-22 shots. The superstar swingman is one loss away from another first-round elimination.

"It's either win or go home," McGrady said. "With me it's always been like that, every time I've been to the playoffs, so I know how it feels. We've got to lay it all on the line. I'm just going to be optimistic about it. If we lose, that's it. Our goal is to be back here in Dallas."

A free throw by Daniels gave Dallas a 79-68 lead before Yao began asserting himself - and missing free throws. He made four baskets to help narrow the margin to 83-79 wth just under seven minutes to go.

"He just had a bad night from the line," Houston coach Jeff Van Gundy said. "That's how it is sometimes."

Terry hit a jumper and 3-pointer, Yao missed two foul shots, and Nowitzki made a jumper to rebuild the lead to 90-79 with 4:27 left. Back came the Rockets as McGrady and Barry drilled 3-pointers around two free throws by David Wesley to make it 90-87 with 3:25 remaining.

The teams traded 7-0 spurts in the second quarter, leaving Dallas with a 46-40 lead. In the final seconds of the first half, the 6-6 Stackhouse won a jump ball from 7-2 Dikembe Mutombo, then drained a 3-pointer at the horn for a 52-44 bulge.

"I was able to sneak under Dikembe and tie him up," Stakchouse said. "I was down at his feet and he was looking around for the open man. He forgot that I was there."