BOSTON (AP) -- Deron Williams had 29 points and 12 assists to lead the Brooklyn Nets to a 101-93 win over the Boston Celtics on Wednesday night.

Brook Lopez scored 21 points and Joe Johnson added 20 for Brooklyn, which won for the 12 time in 18 games overall and beat the Celtics for the third time in four meetings this season.

The Nets moved closer to wrapping up fourth place in the Eastern Conference and clinching homecourt advantage in the first round. Brooklyn owns a 3 1/2-game edge over idle Chicago with four games left to play in the regular season.

Paul Pierce led Boston with 23 points, Jeff Green added 11 and Kevin Garnett had 11 points and eight rebounds in his second game back after missing the previous eight with an inflamed left ankle.

The Celtics, who have dropped four of six, remained three games ahead of Milwaukee for the East's seventh playoff spot, but fell 2 1/2 games behind sixth-place Atlanta, which beat Philadelphia 124-101. The Bucks lost at Orlando in overtime, 113-103.

Garnett got a technical in the second quarter and tangled up Kris Humphries for a jump ball that had the Celtics star rolling over the Nets' center midway into the fourth.

Earlier this season, Rajon Rondo and Humphries were ejected for scuffling under a basket and into the first row of seats after the Nets' big man knocked Garnett to the floor with a hard foul.

The Nets pushed a 10-point halftime lead to 60-45 on Jerry Stackhouse' jumper from the right baseline before Boston started to get some production offensively -- mainly from Pierce. After missing six of their initial seven shots in the second half, the Celtics relied on Pierce driving to the basket where he converted a three-point play and was fouled, hitting five free throws that cut it to 70-62. He had 13 points in the quarter.