Nets guard Spencer Dinwiddie slaps five with forward Joe Harris...

Nets guard Spencer Dinwiddie slaps five with forward Joe Harris after scoring a layup late in the second half against the Nuggets at Barclays Center on Sunday. Credit: Kathleen Malone-Van Dyke

The play call was almost poetic in its simplicity and elegant in its execution.

“Get the ball to Spencer and get out of the way.”

That’s how Kenny Atkinson characterized the play that led to Spencer Dinwiddie’s layup — the one that gave the Nets the lead Sunday afternoon.

The point guard took the ball up the court, drove through traffic and put the Nets up by one with a little less than a minute to go.

But then the Nuggets came back. So Dinwiddie did it again.

His layup with 26.3 seconds remaining proved to be the definitive blow for the Nets, who beat the Nuggets, 105-102, at Barclays Center for their third win in a row.

Dinwiddie’s basket gave the Nets (13-10) a 103-102 lead. Will Barton’s off-balance jumper glanced off the rim with less than 10 seconds to go, and Taurean Prince beat Nikola Jokic for the rebound to all but seal it. Prince’s two free throws completed the scoring.

On the way, the Nets showed considerable growth — a lockdown late-game defense that has begun to shine, a commitment to improvisation with so much of their talent injured, and the ability to find ways to win, even without the perimeter shot they often rely on.

The Nets shot 7-for-28 from three-point range but outrebounded the Nuggets 48-37.

“Sometimes you find your identity from having your back against the wall,” said Dinwiddie, who had 24 points and eight assists and has flourished while subbing for an injured Kyrie Irving.

“We don’t have the luxury of being able to outshoot, outscore. You’ve got 80% of our salary cap out, what should be probably 70% of our scoring out . . . We have no other choice. You think we’re going to score 130? Everybody in the league should know that by now. We’re not going to score 130. Not every night.

“We can get hot. We have great shooters, great players still, but to think that we’re going to be [that type of team] is probably not the right move.”

The Nets are 9-3 in Irving’s absence and also are without Caris LeVert (thumb). Their other big-money player, Kevin Durant, won’t play until next season. But Dinwiddie has scored more than 20 points in 10 of his last 12 games and Jarrett Allen also has thrived.

On Sunday, Allen had 19 points and 11 rebounds, making it eight straight games with at least 10 boards. It was his seventh double-double in eight games and his 12th double-double of the season.

Was this a statement win for the Nets? “I think it is,’’ Allen said. “They’re a great offensive team, even on defense. We still have to come out and play hard, so I think this is a good step in the right direction.”

Jokic had 24 points, 11 rebounds and six assists for the Nuggets, who didn’t take their first lead until the halftime buzzer. The Nets missed a three-point attempt and a contested layup when the Nuggets took the ball up the court and Jamal Murray (21 points) hit a left-wing three-pointer as time expired to give Denver a 54-53 advantage.

In a game with 18 lead changes, the Nets entered the fourth quarter up 82-77.

The Nuggets briefly pulled ahead late in the fourth, taking a 92-89 lead on back-to-back three-pointers by Monte Morris and Jerami Grant.

That, though, is when the Nets got a slew of vital stops and rebounds, led by Prince, who finished with 11 boards. It gave them just enough room for that very simple, very effective play call at the end of the game.

“We’re improving defensively,” Atkinson said. “When you win a game where we make seven threes, that’s good news.”

More Brooklyn Nets