(REUTERS) - The play-off chase would not have died if the Dallas Mavericks lost at home to the lowly New York Knicks on Wednesday.
But it sure would have looked bleak.
Reserve guard J.J. Barea did his part and more to make sure Dallas remains squarely in the hunt.
The wily veteran scored 26 points in a must-have game, and the Mavs rallied past the Knicks 91-89 at American Airlines Centre.
"I'm tired but I'm happy with my team and proud that we got this win," Barea said.
Dallas moved into a tie with the Houston Rockets and the Utah Jazz for seventh place in the Western Conference standings. The three teams, all 37-38, are battling for the last two play-off positions.
Barea led a fourth-quarter charge as Dallas came back from seven down to start the period.
The high-energy backup tied the game at 86-86 with a three-pointer with 2 1/2 minutes remaining.
After Knicks star Carmelo Anthony gave the visitors an 89-88 lead with 1min 1sec remaining, Barea came back with a driving lay-up for put Dallas back on top.
Anthony misfired on two shots on the ensuing possession, but the Knicks rebounded both misses. Anthony, with the ball back in his hands, turned it over after a timeout.
"We really wanted to get (Anthony) the ball at the top of the floor, which is what we got," New York coach Kurt Rambis said.
"We got the ball in his hands and wanted to run down the clock and take the last shot. We couldn't get the space. We just wanted to get him a clear opportunity, but they were trapping on the pick-and-roll."
The Knicks (30-46) had one last chance, but guard Langston Galloway's three-pointer at the buzzer glanced off the rim.
New York did not help themselves with eight turnovers in the fourth.
"It's been our nemesis all year when teams pick up the pressure," Rambis said.
"Part of it is we don't get organized, so when the pressure ramps up, we don't know where our outlets are. That creates a turnover as a result of us not being able to execute properly."
Mavs guard Wesley Matthews scored 16, including seven points in the fourth. Dirk Nowitzki had 11 points and struggled with his shot all night, missing 18 of 23 attempts.
Barea made 10 of 18 shots in scoring at least 25 for the third time this season. The Mavs have won all three of those games. He also had a game-high seven assists.
"I've been having a good rhythm lately," said Barea, who has scored at least 14 points in five consecutive games.
"I came in extra aggressive. I hit my first shot and got a couple of assists early, and I think that got me going and in a great rhythm for the rest of the game."
Anthony made 11 of 22 shots, led all scorers with 31 points and grabbed seven rebounds. Derrick Williams scored 15 and had eight boards while starting in place of rookie sensation Kristaps Porzingis (sore right shoulder).
Porzingis had averaged nearly 21 points over the past four games, and he scored 28 in the meeting against the Mavericks earlier this season.
New York, which led by as many as 11 late in the third period, had just two players score in double figures.
Dallas ended a run of changing the starting line-up in five straight games, sticking with a unit that included rookie swingman Justin Anderson and second-year forward/centre Dwight Powell.
Anderson had seven points and a season-high nine rebounds.
The Mavericks head off a two-game road trip beginning Friday at Detroit. New York return home on Friday to host the Brooklyn Nets.