BOSTON – Deron Williams had 29 points and 12 assists Wednesday night to lead the Brooklyn Nets to a 101-93 victory against the Boston Celtics.

Brook Lopez scored 21 points and Joe Johnson added 20 for Brooklyn, which won for the 12th 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 31/2-game edge over idle Chicago with four games left 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 4 of 6, remained three games ahead of Milwaukee for the East’s seventh playoff spot, but fell 21/2 games behind sixth-place Atlanta.

Garnett got a technical in the second quarter, tangling up Kris Humphries for a jump ball that had Garnett rolling over Humphries 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 Humphries knocked Garnett to the floor with a hard foul.

The Nets pushed a 10-point halftime lead to 60-45 on Jerry Stackhouse’s jumper from the right baseline before Boston started to get production, mainly from Pierce. After missing six of their initial seven shots in the second half, the Celtics relied on Pierce driving to the basket. He had 13 points in the quarter.

The Celtics had no answer for the penetrating, game-controlling Williams, who made key passes and continually found his way to the basket.

Boston sliced its deficit to nine three times in the opening six minutes of the final quarter, but Williams had a pair of baskets during a game-sealing 8-0 run.

Brooklyn hit six from beyond the 3-point line and shot 51.4 percent (19 of 27) in the opening half.

In the opening half, the Nets used a 15-4 run over a five-minute stretch late in the first quarter en route to a 22-21 edge after one. Johnson started the spree by nailing a fadaway. Boston missed six straight shots during Brooklyn’s run.

Then they went on a 18-4 spurt late in the second, turning a two-point deficit into a 12-point lead before Pierce’s driving basket in the closing seconds cut it to 53-43 at halftime. Williams had 11 in the quarter, five in the run. 

NOTES: The teams hadn’t played since Boston beat the Nets by 17 in Brooklyn on Christmas Day. “It’s different,” Nets interim coach P.J. Carlesimo said. “They don’t have Rondo and (Kevin Garnett) is just coming back.” Garnett passed John Stockton for sixth on the NBA’s all-time list in minutes played. … Pierce and Jason Terry both played their 1,100th career game. The Celtics are off until a game in Miami against the Heat on Friday. They play at Orlando on Saturday.