This one turned out to be an all-out celebration.

The New York Knicks had been a thorn in the 76ers' side for the last few seasons. No matter how hard the Sixers played in recent meetings, they just couldn't beat their Atlantic Division rival.

That changed Wednesday night thanks to T.J. McConnell. The point guard hit a buzzer-beating, 12-foot baseline jumper to give the Sixers a 98-97 victory at the Wells Fargo Center. The celebration began once the buzzer sounded.

McConnell sprinted down the court and leaped into the air while doing a fist pump upon reaching the far baseline. While surrounded by his teammates, the second-year player had a stone-cold killer look on his face. Joel Embiid reached out and placed his hands around McConnell's neck and gave a celebratory yell. The two Sixers later embraced as the celebration swirled around them.

"All I could think was run," McConnell said of his first game-winner on any level. "I shot it and made it and I saw my teammates coming after me. . . . They all just corraled me. It was awesome."

The Sixers (11-25) had lost five straight meetings since beating the Knicks on March 20, 2015.

But the Sixers have been on a roll. This victory was their fourth in five games. Meanwhile, the Knicks (17-22) are struggling. They have lost three straight and nine of their last 10.

It appeared that New York was on its way to a much-needed victory. It held a 93-83 lead with 2 minutes, 29 seconds remaining.

The Sixers pulled within one point (95-94) on Embiid's layup with 51.8 seconds left. Derrick Rose put the Knicks back up by three on a layup with 34.5 ticks remaining.

Gerald Henderson hit a pair of free throws on the Sixers' ensuing possession to make it a 97-96 game at the 27.8-second mark. Kristaps Porzingis missed a three-pointer when the Knicks got the ball, and Henderson grabbed the rebound and raced up the court.

The reserve shooting guard passed the ball to Ersan Ilyasova near the three-point line. Knicks small forward Carmelo Anthony tried to double-up on Embiid in the high post, leaving McConnell alone on the base line. After catching the pass from Ilyasova, McConnell spun on Anthony and released the ball with 0.2 seconds left. It was a shot he works on every day at practice with assistant director of player development Chris Babcock.

"I happy for him," Embiid said of McConnell, who is often heckled by fans. "He always kind of gets into it with the fans. As soon as he made that shot, I went up to him and said, 'Now, you can talk trash to them.' It was a big shot.

"The last couple of games he's been starting, he's been carrying us as a point guard."

The Sixers are 5-1 with McConnell in the starting lineup this season. He started at Detroit on Dec. 11 before starting the last five games.

He finished with eight points, a game-high seven assists, and two steals. Embiid paced the Sixers with 21 points, 14 rebounds, and one block.

Anthony finished with a game-high 28 points. Rose added 25 points and four assists.

Rose sure wasn't AWOL on Wednesday night. The Knicks point guard scored 12 of his points on 6-for-7 shooting in the first quarter.

All was well two nights after Rose missed the Knicks game against the New Orleans Pelicans. Rose said he went home to Chicago to be with his mother for a "family issue." He didn't notify the team of his departure and ignored phone calls from teammates and members of the front office. Rose said he didn't pick up the phone because he needed space.

The Knicks gave him a slap on the wrist. He had to pay a fine and was inserted back into the starting lineup Wednesday.

"He's our starter," Knick coach Jeff Hornacek said. "He's been the starter all year, and he's a great player. I think the amount of the fine for missing the game, whatever the other fine was, was what they determined was enough punishment."

Hornacek said Rose spoke to Knicks president of basketball operation Phil Jackson, general manager Steve Mills, Hornacek and his teammates after the incident. The coach said the situation did not damage the trust between Rose and the team.

"These guys are all a pretty close-knit group [like] most teams," Hornacek said. "They understand that things happen. Sure, they're hoping that they knew what was going on with him before the game, but they're all supportive of him and happy he's back."

Embiid suffered a little scare late in the second quarter. He suffered a sprained left ankle. Nerlens Noel subbed in for him with 34.6 seconds before intermission. Embiid returned at the start of the third quarter. He said he was fine.

Jahlil Okafor was sidelined for the third consecutive game.