ORLANDO, Fla. - They've spent the better part of the last seven weeks treading water feverishly, seemingly going under a few times and gasping for air once they resurfaced from the murkiness.

So why should Friday night have been any different?

The Magic tossed the Nets a life preserver and Brooklyn nearly took a screwdriver and plunged a gaping hole into it, evoking thoughts of a potential nightmarish choke job. The Nets almost coughed up a 26-point, third quarter advantage, needing two free throws by Joe Johnson with 22 seconds remaining to seal a 100-98 victory at Amway Center that elevated them to the .500 mark for the first time since Nov. 15.

This one wasn't truly over until Jarrett Jack flung the ball up toward the rafters with a little more than two seconds left and it came down out of bounds in front of the Nets' bench. Brooklyn (15-15) barely outlasted scrappy Orlando, escaping with its third straight win and sixth triumph in its last seven games.

"They kept playing through everything," Jack said. "I thought we kind of played the score a little bit, not being as aggressive as we were to get the lead that we had gotten. So it's a lesson learned.

Paced by Mason Plumlee's 18 points and nine rebounds, and 16 points apiece from high-priced reserves Deron Williams and Brook Lopez, the Nets held an 86-60 lead with 36 seconds left in the third quarter. But the Magic (13-23) got scrappy and things began spiraling in the wrong direction, leading to a few anxious moments for Brooklyn.

On the strength of 26 combined points by Elfrid Payton and Ben Gordon, Orlando canned 14 of 23 attempts in the fourth quarter, cashing eight Nets' turnovers into 12 points. The Magic rattled off a furious 24-3 run that had them in position to tie it late, but Evan Fornier rushed up a three-pointer with 26.3 seconds remaining that clanked off the side of the rim and the Nets made just enough plays at the end to pull it out.

"Honestly what went through our mind was, 'The game was in hand. We've got a win,'" Plumlee said. "That's clearly not the way to approach the fourth quarter. It's not a good way to end the game anyway you look at it."

Here's how well things worked for the Nets through the initial 36 minutes: Even Kevin Garnett drained a three-pointer in the third quarter, his first for the Nets, who reeled off 34 points in the third quarter.

"Shoutout to Rasheed Wallace," Garnett said. "He's always on my [expletive] about shooting threes. I told him that's what got him out of the league, so I haven't been shooting too many. But today, people don't know I work on my game every day. Shooting threes is part of my routine. I got it, I shot it and I made it."

All those feel-good things the Nets accomplished in the first three quarters were almost rendered moot. The good ball movement. The solid play of Williams and Lopez. A gritty defensive effort.

"Every win is great for us because we are moving up in the standings and putting distance between the teams behind us," said Williams, who had a team-high seven assists. "And that's what we've got to continue to do."