Taurean Prince of the Nets attempts a game-tying shot during...

Taurean Prince of the Nets attempts a game-tying shot during the final moments of the fourth quarter against Michael Carter-Williams of the Magic at Barclays Center on Monday. Credit: Jim McIsaac

It would seem as if the best way for the Nets to avoid a first-round knockout in the playoffs would be to avoid facing the NBA-best Bucks. The way for them to do that would be to avoid planting themselves in the dirt as the eighth seed.

That would go for Orlando, too. So that gave Monday night’s Nets-Magic game at Barclays Center a little more flavor because the Nets arrived seventh in the Eastern Conference, 2 1⁄2 games ahead of the No. 8 Magic.

The Nets ended up not liking the flavor. They were unable to hold on to a 19-point third-quarter lead and fell, 115-113.

Make that a 1 1⁄2-game spread in the race to stay away from Milwaukee (49-8).

“I think both teams recognized the importance of this game specifically,” Spencer Dinwiddie said. “I think they raised their level of play and made shots, and we didn’t do a good enough job stopping them.”

Dinwiddie led the Nets with 24 points and eight assists. Caris LeVert added 19 points.

Aaron Gordon had 27 points and 10 rebounds and Evan Fournier and Terrence Ross scored 21 each for Orlando.

So the Nets dropped to 26-30, including two losses in two tries with two to go against the Magic — and a 20-point loss in their only game against the Bucks.

Orlando moved to 25-32, including three losses in three tries by an average of 19 points against the Bucks.

“It’s big,” Gordon said of the win. “ . . . If it ever comes down to a tiebreaker, we have a two-game lead on them.”

With Kyrie Irving out for the season with a shoulder injury after playing only 20 games, the Nets have remained in play largely because of their defense, but it let them down in the second half Monday night. So they found themselves in an airtight game in the fourth quarter.

Nikola Vucevic dunked to give Orlando a 110-109 edge and Gordon’s jumper made it a three-point lead. Dinwiddie fed Jarrett Allen for an alley-oop to cut it to 112-111, but Gordon countered with a step-back three-pointer from the left side for a four-point advantage.

Allen dunked again to cut it to 115-113 with 55.5 seconds left. Vucevic missed a jumper, but Gordon blocked LeVert’s shot and Taurean Prince missed a three. Orlando’s Markelle Fultz turned the ball over with 8.8 seconds left, but Prince missed badly on a desperation three with three-tenths of a second left.

“We gave up 74 points [in the second half],” coach Kenny Atkinson said. “I think that’s the story there.”

The Nets, who went to the line only eight times and made five, led by 13 at halftime. In the first minute of the third, Dinwiddie nailed two threes for a 60-43 lead. Joe Harris’ three-pointer made it 67-48.

Orlando then outscored the Nets 33-18 to cut the 19-point edge to four. Gordon hit a three with 30.4 seconds left in the third to make it 85-81 and Ross scored inside early in the fourth to give Orlando a one-point lead. “We just kept pushing,” he said.

The teams traded the advantage 10 times from there before the Magic kept their grip.

And to think they were held to 35.6% shooting, including 3-for-18 on threes, in the first half.

“It’s tough,” Allen said. “We definitely wanted this game . . . But at the end of the day, we threw the game away.”

Notes & quotes: Irving attended Kobe Bryant’s memorial at Staples Center in Los Angeles on Monday. The point guard has yet to have surgery. “I know he’s talking with the medical team and the performance team to find the best time and the best place and all that, the best doctor,” Atkinson said. “It’s not even the best. It’s like, what fits?”

More Brooklyn Nets

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME ONLINE