NEW YORK -- The Dallas Mavericks were embarrassed and humiliated Friday night in Philadelphia. Less than 48 hours later, the feeling was significantly different.
J.J. Barea was a big reason for the change of mood inside the Dallas locker room.
Barea scored 11 of his 20 points in the fourth quarter and the Mavericks never trailed but were forced to hold on for a 111-104 victory over the Brooklyn Nets on Sunday afternoon.
Dallas rebounded from its worst loss of the season, a 116-78 drubbing to the 76ers by taking control from the start, building an 18-point lead and bending but not breaking down the stretch.
"Our guys knew we could do a lot better and compete a lot better," Dallas coach Rick Carlisle said. "We made a stand today and it's not a team with not a great record but they do go hard and it is an NBA game. We need to get as many wins as we can right now and we'll take it."
Barea was the one responsible for the Mavericks staving off a late-game collapse as he scored nine straight points in a span of 2:31 to help Dallas gain much-needed separation. He did so when he couldn't find Nerlens Noel inside because Brook Lopez was protecting the rim.
"Big shots," Dallas forward Dirk Nowitzki said after becoming the sixth player to reach 31,000 career points. "That's what he does."
On Sunday, what Barea did was make a 17-footer that put the Mavericks up 96-92 with 4:47 remaining. He converted a 15-footer with 3:59 left as Dallas maintained a four-point lead at 98-94.
A 20-footer with 2:55 remaining was followed by a 3-pointer to give Dallas a 103-96 lead with 2:16 to play.
"I was being aggressive, I knew Lopez was staying down, so I couldn't get the lobs to Noel," Barea said. "I was looking for my mid-range that it was working. I stayed aggressive on those and they set some good screens on me and I was able to knock them down."
Barea's shots occurred while Nowitzki was getting a rest. Nowitzki scored 20 of his 23 points through three quarters as Dallas took an 82-72 lead and the Mavericks held a 92-84 lead when he sat down.
"He kind of iced it for us there," Nowitzki said. "He's made big plays for this franchise for a long, long time."
Despite Barea's clutch baskets, Dallas did not seal the game until the final minute. The Nets were within 103-101 following two free throws by Randy Foye with 80 seconds remaining but consecutive hoops by Harrison Barnes sealed the win.
"I thought that was the nail in the coffin," Nets coach Kenny Atkinson said of Barea's 3-pointer. "He hit those mid-range, we were going over on the mid-range ones, then we went under and he made us pay. Heck of a player, he made the big plays down the stretch.
"He was just entirely too comfortable and that's where I think I've just got to read the situation and make a decision myself in the middle of the game where I've got to step up, pressure him more and rely on my teammates for help," Lopez said of Barea's shots.
Nowitzki and Barea were provided help offensively as three others reached double figures for Dallas, which shot 53.9 percent after an intense film session on Saturday to review what went wrong against the 76ers.
Barnes added 19, Wesley Matthews contributed 15 and Devin Harris chipped in 11.
Lopez led the Nets with 27 points and Spencer Dinwiddie added 18. Dinwiddie handled point guard duties for Brooklyn most of the game after Jeremy Lin exited with a sprained right ankle.
Lin was injured midway through the first quarter going for an offensive rebound and the Nets ruled him out of the game in the second quarter. The Nets did not provide any further information about Lin's injury.
The Mavericks appeared to be on their way to sealing it when Dorian Finney-Smith's 3-pointer gave them a 91-79 lead with 9:27 remaining. Before Barea's run, Dallas struggled to expand the lead but never gave it up, allowing the Nets to get within 93-92 on a 16-footer by Dinwiddie with 5:51 remaining.
NOTES: Nets coach Kenny Atkinson said he regretted not calling a timeout when G Jeremy Lin was sitting at the scorer's table for several minutes in the fourth quarter of Friday's 98-95 loss to the Boston Celtics. ... The Mavericks' roster contains four undrafted rookies, including G Yogi Ferrell, who appeared in 10 games for Brooklyn earlier this season. ... Dallas coach Rick Carlisle said the Mavericks worked out Ferrell before last year's draft. ... Brooklyn G Joe Harris (sprained left shoulder) missed his ninth straight game while G Sean Kilpatrick sat out for the third straight contest. ... Dallas signed G Manny Harris and F Jarrod Uthoff to second 10-day contracts. ... Brooklyn owner Mikhail Prokhorov attended the game and is expected to attend the next two home games Tuesday against Detroit and Thursday against Phoenix.