Arron Afflalo took a foul shot and saw the basketball hit off the back of the rim. The ball caromed toward him, and as he approached it, splitting two Brooklyn Nets in the process, the ball bounced off him and toward the Orlando Magic bench.

Afflalo could've allowed the ball to roll out of bounds.

Instead, he dived headfirst toward the bench, hit the parquet floor on his right hip and extended fully to try to keep the ball in play.

The ball went out of bounds, but the effort set the tone for his night and his team's night. Fueled by Afflalo's most aggressive game in weeks and by contributions from up and down the roster, the Magic beat the Nets 115-111 at Amway Center.

"These last five games, I need to make sure I show up, just close out the season strong," Afflalo said.

He did that against the Nets. Afflalo scored a team-high 25 points on 9-of-16 shooting and helped the Magic hold off a late Nets rally.

Afflalo didn't do it alone.

With the Magic clinging to a 108-107 lead, power forward Kyle O'Quinn passed to Maurice Harkless as Harkless made a backdoor cut, and Harkless scored on an easy dunk to give Orlando some desperately needed breathing room with 24.6 seconds left.

A few sequences later, with the Magic ahead by three points, O'Quinn blocked a potential game-tying 3-pointer by Joe Johnson with 9.9 seconds to go.

"He's one of the best at drawing fouls," O'Quinn said of Johnson. "Coach told me to stay down. I did so, and I was sticking to what he said. It worked out for us.

"It means a lot. Going into the next year, going into the next season, you want to take these habits into the summer and build on this next year."

E'Twaun Moore scored 17 points — including 14 consecutive Magic points in the second quarter — and sank all six of his shot attempts. Tobias Harris was held scoreless in the first half, but Harris poured in 16 points in the second half.

The Magic (23-55) eked out the win even though they were missing starting center Nik Vucevic for the third consecutive game because of a sore left Achilles' tendon. Dewayne Dedmon started in Vucevic's place, and the former NBA Development League player scored four points and collected nine rebounds in 20 minutes.

The win could be costly to Orlando in the long run.