Heading into Monday’s rematch with the Atlantic Division leading Raptors in Brooklyn — which came six weeks to the day after the Nets embarrassingly threw away the last meeting between the two teams inside Barclays Center — the Nets didn’t hesitate to say they were out for revenge against their division rivals.

Then the Nets went out and backed up their words on the court, recovering from a sluggish start to knock off the Raptors, 101-97, in front of 17,351 to keep their hopes of winning the Atlantic Division alive and potentially previewing what would be a terrific first-round playoff series between these teams next month.

“If we lose this game, there’s probably no chance of winning the Atlantic Division,” said Paul Pierce after hitting the go-ahead 3-pointer with 1:14 let to put the Nets ahead for good. “It was a huge game, knowing we still have a chance to win the division, move up as a seed and you never know, this could be a team we play in the first round.”

With the win — the sixth victory for the Nets (32-30) in their last seven games, and their eight straight win in Brooklyn — the Nets moved within three games of the Raptors with 20 games to play, and knotted up the season series at two games apiece. The Nets also moved within a half-game of the fifth-place Wizards after Washington lost in Miami Monday night.

Ever since Deron Williams’ errant inbounds pass turned into a Patrick Patterson buzzer-beater that gave Toronto a 104-103 back on Jan. 27, the Nets had been looking forward to a chance to get the Raptors back.

And the Nets found themselves in virtually the exact same situation they were in January, holding onto a lead inside the final minutes after Pierce — who Nets coach Jason Kidd initially didn’t expect to play after he left Sunday’s win over the Kings after 73 seconds with a sore right shoulder — hit a 3-pointer over Kyle Lowry to give Brooklyn a 97-94 lead with 1:14 remaining.