TORONTO -- Miami, here they come.

The most expensive team in NBA history staved off what would've been a disappointing early-season exit, completing the comeback from a 3-2 series deficit against the third-seeded Raptors with a gritty 104-103 Game 7 victory in front of a rabid sellout crowd of 20,457 at Air Canada Centre.

By dispatching Toronto, the sixth-seeded Nets advanced to meet the two-time defending champion Heat in the Eastern Conference semifinals, which tips off Tuesday at AmericanAirlines Arena.

Still, these are the Nets, so there was almost no way this was going to be easy. Shaun Livingston sank two critical free throws with 13.2 seconds remaining for a 104-101 advantage, but an easy layup by Terrence Ross trimmed the Nets' cushion back to a mere point.

However, on the ensuing possession, Livingston's intended inbounds pass for Paul Pierce was batted around and off of Pierce and out of bounds by Ross, giving Toronto a chance at the last-second heartbreak.

But Paul Pierce managed to block Kyle Lowry's six-foot floater in the lane, allowing the Nets to escape by the skin of their teeth and avoid what would've been disastrous defeat considering they led by as many as 12 points in the second half.

Joe Johnson led the Nets with 26 points.

Kyle Lowry paced the Raptors with 26 points, though he shot just 6-for 17-from the field.

Amir Johnson torched the Nets for 20 points and 10 rebounds before fouling out early in the fourth quarter, a byproduct of him collecting his fifth foul with a just over nine minutes remaining.