New York, NY (SportsNetwork.com) - Brook Lopez was at the right place in the waning moments to help the Brooklyn Nets fend off the New York Knicks on Wednesday night.

Lopez's go-ahead putback layup with 2.0 seconds remaining lifted the Nets to a 100-98 win over the Knicks.

New York trailed by as many as 14 in the fourth quarter, but Cleanthony Early, who scored all 14 of his points in the final frame, tied the game at 98-98 following a left wing 3-pointer with 1:07 left.

After a couple empty possessions, Deron Williams drove the lane on Brooklyn's final touch. His shot was off the mark and so was Lopez's tip-in, but Lopez corralled the ball again and layed it in.

"I was right there around the rim and I just tried to keep it alive and put it back in," Lopez said.

Early's straightaway triple from the top of the arc at the other end missed the rim to the right.

The victory tied the Nets with the Miami Heat for the final two playoff spots in the Eastern Conference. The Boston Celtics are a half-game behind following their win Wednesday night over the Indiana Pacers, who sit 2 1/2 games back of a playoff spot.

Williams had 26 points, seven assists and seven rebounds, while Lopez added 18 points and seven boards for the Nets, who have won five straight and seven of their last eight games.

Andrea Bargnani netted 22 points for New York, which has dropped eight consecutive contests.

"Winning in this league generally always comes down to getting a stop," Knicks coach Derek Fisher said.

The Knicks never led in this one and were down 85-71 heading into the fourth before using a 12-4 swing to climb back in it. Early put in seven points during the burst, which he capped by finishing off Shane Larkin's left wing lob with a layup, getting the hosts within 94-93 with 5:05 to play.

Earlier, an 11-2 Brooklyn run helped it race out to a 21-11 advantage. Alan Anderson capped the surge with a turnaround banker at the 3:31 mark of the opening frame.

The Nets led 30-21 following a quarter of play, but six straight points from the Knicks helped them claw within two midway through the second. Lance Thomas hit a jumper to trim the deficit to 43-41.

Brooklyn bumped the margin back up to 58-53 at the break and began to pull away again in the third following a 12-2 burst. Markel Brown tallied six points during the swing, which was finished off on a Lopez jumper for a 78-62 cushion.

Game Notes

Lopez came in averaging 28.1 points and 9.6 rebounds per game while shooting 62 percent from the field over his last seven games ... Brooklyn swept the season series with the Knicks, last doing it during the 2006-07 campaign ... The Nets haven't won five straight since Jan. 16-26, 2014.