As LeBron James caught a picture-perfect pass from Rashard Lewis and began flying toward the rim as the final seconds ticked off the clock inside American Airlines Arena Tuesday night, it looked like the Heat finally would snap their season-long skid against the Nets.

But then, out of nowhere, James suddenly had company at the rim in the form of Nets rookie center Mason Plumlee, who managed to stuff the four-time league MVP’s two-handed dunk attempt at the rim and allow Brooklyn to emerge with an 88-87 victory that gave the Nets (43-34) a season sweep over the two-time defending champions.

“It’s winning time,” Plumlee said afterward in between playful taunts from his veteran teammates to get back to his rookie chores. “It doesn’t matter if it’s Dwight [Howard], LeBron, whoever … you just have to meet them at the rim.

“There will be times I get dunked on, but they’re going to have to go through me or over me.”

The frantic final few seconds of the game began with Joe Johnson, who led the Nets with 19 points,
launched an errant 3-pointer as the shot clock was winding down and Nets clinging to that 88-87 lead with 10.5 seconds left. The shot missed badly, slamming off the backboard and straight into the hands of Ray Allen.

Allen immediately shoveled the ball to James, who took off up the floor like a freight train, only to have Johnson and Paul Pierce cut off what briefly appeared to be an open lane to the rim. In doing so, they left open Lewis, who was cutting in from the left wing, and whom James — who finished with 29 points, 10 rebounds and six assists — hit with a bounce pass.

But after Lewis dribbled along the baseline, both Pierce and Plumlee cut off what initially looked like an open opportunity for a reverse layup on the other side of the basket. That’s when Lewis threw the ball past both defenders to James on the left block, with what appeared to be an open lane to the rim. But as he went up, Plumlee managed to recover in time to meet him at the rim, getting his hand on the ball before clasping hands with James on the follow through.