DALLAS (AP) -- Dirk Nowitzki scored a season-high 22 points, Harrison Barnes had 21 and the last-place Dallas Mavericks spoiled Isaiah Thomas' strong debut with the Lakers, beating Los Angeles 130-123 on Saturday night.
Thomas finished with 22 points and already looks like a better fit in coach Luke Walton's offense than he did in an ill-fated 15-game stint with Cleveland after the offseason trade that sent Kyrie Irving to Boston.
The diminutive guard's first half with the Lakers was his highest-scoring half of the season, a team-high 16 points.
Thomas, who was part of a four-player deal at the trading deadline that also brought Channing Frye, missed the first 36 games recovering from a hip injury.
Doug McDermott had eight points in his Dallas debut following a deadline deal that brought him from New York and was part of a youthful closing lineup that outscored the Lakers 13-5 in the final 3:09.
The Lakers had a season-best, four-game winning streak stopped for the third time in a month.
Nowitzki, Barnes and starting guard Wesley Matthews all sat in the last three minutes, and rookie guard Dennis Smith Jr. put Dallas ahead for good at 119-118 on a layup. Smith finished with 14 points, and the Mavericks had a season high in points.
Julius Randle had 26 points, eight rebounds and seven assists for the Lakers, and Brandon Ingram scored 22 points. Kyle Kuzma had 12 points and 15 rebounds.
Dwight Powell scored 19, two shy of his career high, for Dallas. J.J. Barea had 10 points and nine assists.
Thomas entered the game to a noticeable ovation from the usually solid number of Lakers fans in the Dallas crowd, and hit a 3 from the left wing on his first LA possession in what proved to be just a start. He was 4 of 7 from long range before halftime.
Lakers: G Lonzo Ball missed his 13th straight game with a sore left knee. ... Thomas got a flagrant foul in the second half when he pulled Kyle Collinsworth down by the shoulders when the Dallas guard was going up for a dunk. ... Brook Lopez had 16 points, and Kentavious Caldwell-Pope added 14. ... The Lakers matched a season high with 16 3-pointers.
Mavericks: F Josh McRoberts was waived. He played in two games after spending the first 37 games on the inactive list with a left foot injury. He was acquired with a second-round pick and cash for center A.J. Hammons last summer. ... McDermott, who came from the Knicks in a three-team trade at the deadline, scored his first Dallas points on a breakaway dunk soon after entering the game in the first quarter. He added a tomahawk slam in the second half.
Lakers: At New Orleans on Wednesday.
Mavericks: At Houston on Sunday.