Spencer Dinwiddie recorded a season-high 31 points as the Dallas Mavericks defeated the Detroit Pistons 123-117 on Friday night. P.J. Washington Jr. added 27 points with a season-best five three-pointers to help Dallas snap a four-game losing streak.

The Mavericks (34-37) controlled the game with efficiency at the free-throw line, converting 27 of 36 attempts compared to Detroit’s 14 of 19. Dinwiddie accounted for 11 makes at the stripe, playing a crucial role in the team’s offensive execution.

Klay Thompson contributed 20 points, while Naji Marshall posted a double-double with 19 points and 11 rebounds. Dallas secured just its second win in 11 games as it fights to stay in the Western Conference play-in race after reaching last season’s NBA Finals.

Cade Cunningham led all scorers with 35 points, shooting 15-for-30 from the field for the Pistons (39-32). Detroit remains in sixth place in the Eastern Conference, trailing Milwaukee by one game in the standings.

Tim Hardaway Jr., who spent over five seasons with the Mavericks before being traded last summer, received a tribute video in the first quarter. However, he exited in the second quarter with a right ankle sprain and finished scoreless in eight minutes.

Dallas relied on all nine available players and set a franchise record with its 39th different starting lineup of the season. Kessler Edwards was held out, leaving him with one game of eligibility remaining on his two-way contract.

Injury updates from the Mavericks included Anthony Davis (left adductor strain), Dereck Lively II (right ankle stress fracture), and Daniel Gafford (right knee sprain), who all participated in G League practice Friday.

With 23.8 seconds remaining, Dallas led 118-115 when Brandon Williams broke Detroit’s full-court press and converted a three-point play to seal the win. The Pistons, who rank second in fast-break points this season, were held to just six.