This was the kind of moment the Nets brought Paul Pierce to Brooklyn for.

The Nets found themselves tied with the two-time defending champion Heat with two minutes to go after Dwyane Wade made a free throw to even the score at 92, sending a sellout crowd of 19,616 to its feet inside of AmericanAirlines Arena Wednesday night, expecting the Heat to close out a victory over the resurgent Nets.

But then Pierce, like he has so many times before against this team and in this building, decided that wasn’t how the night was going to end. Instead, Pierce got the ball on the wing, pump-faked a defender into the air, drove to the rim and laid the ball into the basket from between a couple of defenders, scoring the final two of his 29 points to put the Nets ahead for good, helping them earn a 96-95 victory.

“As a veteran, playing in so many of these big games, you always try to get yourself prepared mentally, physically,” Pierce said. “You know what it’s going to take to come into one of these types of territories and get a win.

“From the time I woke up at shootaround, I was really locked in. … I understood this is going to be one of our toughest games to date.”

He was right about that, but the Nets (33-30), who beat the Heat for the third time this season, were able to come away with the win anyway. That largely was because of the throwback performance from Pierce, who has long been a thorn in the side of LeBron James and Co., and even had a hand in creating the monster the Heat have become because of the success he, Kevin Garnett and current Heat member Ray Allen had together in Boston.

Pierce, aka “The Truth,” looked like the player who often got the better of his one-on-one matchups with James back in his days in Cleveland. He scored 22 points in the second half in a game in which neither team ever led by double-digits and was entertaining, though sloppy, throughout.

Pierce scored 17 of those points in the third quarter — going 5-for-5 from the field, including 3-for-3 from 3-point range — helping the Nets cling to a 73-71 lead heading into the fourth.

“He is a big-time player,” said Dwyane Wade, who finished with 22 points. “He makes shots, and he has that slow, methodical game where you don’t know if he is going to shoot or go to the basket.