PHILADELPHIA — Kevin Garnett and Rajon Rondo got it right when it mattered.

Garnett banked in a shot off Rondo’s alley-oop pass with 1.4 seconds left to give the Boston Celtics their ninth straight victory, 102-101 over the Philadelphia 76ers on Thursday night.

“Rajon threw a perfect pass and I just banked it,” Garnett said. “The crazy part about all that is that I messed that play up so many times in practice. It’s only right that the basketball gods gave it to me tonight. It was a good win for us, a grind-out win. This team has been playing unbelievably.”

After Philadelphia’s Andre Iguodala drove for a hook shot with 6.6 seconds left to give Philadelphia a 101-100 lead, Rondo flipped a pass from just outside the 3-point line to Garnett for the winner.

“We worked on that last week,” Celtics coach Doc Rivers said. “We tried to run it early and had bad timing. It’s just funny how things work out. It’s a low-clock play. The ball’s in the best passer’s hands, and you have shooters on the floor. The whole sell was Paul Pierce and it worked.”

Garnett then ended the game by intercepting the 76ers’ inbounds pass.

Ray Allen led Eastern Conference-leading Boston with 23 points, Rondo had 19 points and 14 assists for his 11th double-double of the season, Glen Davis added 16 points, and Garnett finished with 14.

“It was a gutsy win,” Pierce said. “It didn’t seem like we had it all night. We couldn’t get really consistent momentum in the game or get a consistent flow. But good teams find a way to win. There was good execution down the stretch.”

Jodie Meeks led Philadelphia with 19 points, including going 4-for-4 from three-point range. Lou Williams and Thaddeus Young had 16 each, and Elton Brand added 13 points and 14 rebounds.

Trailing 80-72 with 2:39 left in the third, the Celtics rallied with a 9-0 run — pulling ahead 81-80 lead on Rondo’s 3-pointer with 0.9 seconds left in the period to set up a tight fourth quarter that featured 14 lead changes.

Iguodala gave the Sixers two leads in the closing minute. Davis erased the first one with a 15-foot jumper before Garnett’s winner.

A crowd of 17,948 — the 76ers’ second-largest of the season — packed into the Wells Fargo Center, many of them decked out in green and white.

Neither team led by more than eight points.

“What a heartbreaking loss,” 76ers coach Doug Collins said. “They have so many different ways that they can attack on the offensive end. It was just a shame. It would have been an incredible win for us here tonight.”

NOTES: Shaquille O’Neal, averaging 11.2 points this season for Boston, missed the game because of a sore right calf, while Jermaine O’Neal sat out with a sore left knee. … Boston has won 11 of its last 13 games against Philadelphia and leads the series 238-176. … Brand has seven double-doubles this season — matching his total from 2009-10 — and 368 in his career.

Mavericks 102, Nets 89

DALLAS — With former coach Avery Johnson in the house, the Dallas Mavericks kept their emotions in check and rolled to a comfortable victory.

Dirk Nowitzki had 21 points and 10 rebounds, Shawn Marion added 18 points, and Dallas stretched its winning streak to 11 games with a 102-89 victory over the New Jersey Nets on Thursday night in Johnson’s return to Dallas.

Johnson, fired by the Mavericks after the 2007-08 season, is in his first season with the Nets.

Jason Terry and Caron Butler added 15 points each, and J.J. Barea had a career-high 13 assists to help the Mavericks extend the NBA’s longest current winning streak.

“I got to shake his hand and hug him before the game,” said Terry about Johnson, who became the Mavericks’ coach late in the 2004-05 season, and led Dallas to its only trip to the NBA Finals in 2006 when the Mavs were beaten by the Miami Heat in six games.

“I actually thought it would be even a little more emotional. But it subsided as we got into the flow.”

Barea got his start in the NBA with Johnson as his coach.

“He was the guy that gave me a chance to be in the NBA,” Barea said. “He showed me a lot my first two years here, so it’s always special.”

Brook Lopez led New Jersey with 24 points, Anthony Morrow had 21, and former Maverick Kris Humphries finished with 16 points and 13 rebounds. The Nets have lost six straight and 11 in a row on the road.

Johnson admitted his first game in Dallas since his firing meant more to him than a standard regular-season visit, but the short-handed Nets had a tough time handling the veteran Mavericks.

“It was pretty emotional,” said Johnson, who hugged several Mavericks as the teams left the court. “A lot of friends and family are here tonight…but it was good seeing some of the guys.”

New Jersey point guard Devin Harris sat out the final three quarters because of a sprained left shoulder. Harris, who played for the Mavs from 2004-08, was injured when he tried to deflect an alley-oop pass to Tyson Chandler and fell to the floor. He was scoreless in 9:22.

Harris said he hoped to play in New Jersey’s next game Sunday at home against the Los Angeles Lakers.

“It doesn’t feel good,” Harris said. “It’s the one part of the body I wish I didn’t hit was the left shoulder. It was just a tough play. I kind of used him to brace myself up to get the ball, but he wasn’t there to break my fall, fell kind of hard. I was going to try and give it a go, but coach thought otherwise.”

New Jersey also was without rookie forward Derrick Favors, sidelined by a bruised thigh. Favors, the third overall pick in the June draft, was hurt Tuesday night in a loss at Atlanta.

The Mavs pushed their lead to 21 points early in the third quarter, but the Nets cut it to 79-69 with a 28-17 run over the final 9:53 of the quarter. New Jersey caught up by driving to the basket and getting fouled, going 15 for 18 from the free throw line in the third quarter.

New Jersey crept as close as 81-73 early in the fourth quarter, but Terry’s basket with 6:04 left capped a 13-3 run for a 94-78 lead.

“(The Nets) hung in,” Mavs coach Rick Carlisle said. “They played hard and kept grinding. We did the same and were able to get the win.”

Dallas shot 72 percent from the floor (13 for 18) to grab a 30-19 lead after one quarter.

The Mavs were up by 18 in the second quarter and carried a 55-40 edge into the break with the help of a 19-3 advantage in fast-break points.

Marion went 6 for 6 from the field in the first half, and Dallas was 24 for 37 (64.9 percent).

NOTES: Dallas has won its last 11 at home against New Jersey. The Nets’ last victory in Dallas was on March 2, 2000. … Chandler returned to the starting lineup after missing the previous game with a stomach virus. Chandler is still feeling the effects of the illness and lacked energy, finishing with two points, five rebounds and five fouls… Nets rookie F Damion James got his first NBA start. James played for the University of Texas. … Johnson said Favors will try to practice Saturday with the aim of returning Sunday against the Lakers. … Dallas’ longest winning streak is 17 games.