NEW YORK (AP) — When Brooklyn ran off 17 straight points to erase an 18-point deficit in the third quarter, Phoenix guard Devin Booker thought back to last season, when his teammates often bickered among themselves when they faced huge deficits.

This time, the Suns remained steady.

The Nets added another spurt to lead in the fourth quarter, but behind 32 points from Booker and a stellar final period by T.J. Warren, the Suns rallied to beat Brooklyn 122-114 on Tuesday night.

"We called a timeout and we came together," Booker said. "Our problem last year, when teams used to go on a run, it used to be a domino effect. We used to get down on each other, start arguing."

Mike James had 24 points, and Warren scored 14 of his 20 points during the fourth for the Suns, who were up 83-65 with 5:58 to go in the third quarter after Booker pulled up with a 19-foot jumper.

Then Brooklyn rallied, and Phoenix seemed headed for a disappointing defeat after Ronda Hollis-Jefferson's basket gave Brooklyn an eight-point lead with 6:35 left in the fourth.

Before that, Suns interim coach Jay Triano had gambled on Warren, who started the fourth with five fouls, as Brooklyn's defense clogged Booker, who only managed two points in the last 12 minutes of the game.

"We had to risk putting him back in the game just to get our offense going," Triano said. "When they lean all over Devin Booker, it opens up space for T.J., and he got us going in the fourth quarter when we needed baskets."

The Suns, who lost a tough one at Portland on Saturday, quickly answered with a 24-8 run for their first win on their five-game road trip.

Phoenix outrebounded Brooklyn 66-44, with Alex Len coming off the bench to lead the way with 15.

D'Angelo Russell scored 33 points and Hollis-Jefferson had 21 for the Nets, who've lost three straight after beating the Cleveland Cavaliers last Wednesday at home.

"We could do a better job," Hollis-Jefferson said. "I feel like we should definitely make better decisions. At the end of the day, I put the blame on us."

Warren and James combined on a 7-0 run that closed the lead to 106-101 with 6:15, forcing the Nets to call a timeout.

"I thought Warren really hurt us," Nets coach Kenny Atkinson said. "He had some big offensive rebounds at the end and we couldn't keep off him. I think Devin Booker attracts a lot of attention."

After a miss by the Nets, Warren tipped in Booker's failed layup to initiate a 9-0 run capped by Dragan Bender's 3-pointer that gave the Suns a 116-108 lead with 2:03 left in the game.

MEMORIAL MOMENT

A moment of silence was held prior to the national anthem at Barclays Center after a man in a rented pickup truck mowed down pedestrians and cyclists along a busy bike path near the World Trade Center memorial, killing at least eight and seriously injuring 11.

LATE ARRIVAL

The Suns' bus to the arena was delayed by the terror incident, which happened two blocks away from their hotel.

TIP-INS

Suns: Phoenix played for the fourth straight year on Halloween, improving to 8-9 on the holiday. ... Tyson Chandler grabbed 13 rebounds.

Nets: Brooklyn has lost five straight games played on Halloween, dropping to 6-8, including 5-5 at home. ... Reserve forward Quincy Acy (left groin strain) missed his second straight game. ... Brooklyn committed a season-low seven points and edged the Suns 22-13 in fastbreak points.

UP NEXT

Suns: Visit Washington on Wednesday night.

Nets: Visit the Los Angeles Lakers on Friday night for the start of a five-game road trip.

___

More AP basketball: https://apnews.com/tag/NBAbasketball