The 76ers overcame late turnovers to pass the first test of their pivotal stretch.

They defeated the Toronto Raptors, 110-104, in Sunday’s much-anticipated matchup at the Wells Fargo Center.

This was the Sixers’ first of 13 games against a team with a winning record in an 18-game stretch. Ten of the games are against squads ranked in the top five of the Eastern and Western Conference standings.

The Sixers improved to 17-7 overall and remain unbeaten at home through 12 games. They moved up to fourth place in the Eastern Conference, a game ahead of the fifth-place Raptors (15-7).

But Philly almost squandered a 20-point fourth-quarter lead while committing 11 turnovers. Six of those turnovers came in the final three minutes after Toronto went to a press, and the Raptors pulled within five points with 14 seconds left.

“Some of it, you scratch your head and try to coach better and help them more,” Sixers coach Brett Brown said of the turnovers. “It is disappointing the way it ended because I think for the most part we played good basketball. It is just the way it ended, it puts a sour taste in your mouth.”

Tobias Harris paced the Sixers with 26 points. Rookie reserve Matisse Thybulle added a career-high 20 points after being listed as questionable with a sprained right ankle. He made a career-high five three-pointers in eight attempts while shooting 6-for-9 overall. The former University of Washington standout also had three assists, three steals, and one block.

Thybulle suffered the ankle injury in the first half of Saturday’s game against Cleveland and didn’t return after intermission. He went through a pregame warmup at the arena Sunday to determine his status for the game.

Thybulle said the “confidence my teammates and coaches have in me is huge. Knowing at the end of the day they believe in me and have trust in me, and [I] go out and make plays and contribute, is really huge for my own personal confidence.”

Meanwhile, Ben Simmons finished with 16 points, 11 rebounds, nine assists and five turnovers. Joel Embiid, who went scoreless in a loss at Toronto on Nov. 25, had 10 points to go with eight rebounds and six assists. He made 3 of 7 shots, went 4-for-6 from the foul line and had season-high six assists/ However, he committed seven turnovers after posting eight in Thursday’s loss to Washington, and didn’t feel that he redeemed himself for the previous game against the Raptors.

“It wasn’t even close,” Embiid said. “I don’t see any difference from the zero points I had against them.”

Back in November against the Raptors, he missed all 11 shots from the field and went 0-for-3 from the foul line.

James Ennis and Al Horford (both with 11 points) were the Sixers’ other double-figure scorers.

North Philly native and Villanova product Kyle Lowry paced the Raptors with 26 points.

Marc Gasol, who has given Embiid fits in the past, left the game after picking up his second foul with 6:55 left in the first quarter. Embiid also exited the game at the time. But when Embiid re-entered at the 2:40 mark in the quarter, he was guarded by Serge Ibaka as Gasol remained on the bench.

Embiid missed his lone shot attempt of the first quarter while being guarded by Gasol. But he made his second shot attempt with 27 seconds into the second quarter as Gasol remained on the bench. Then Embiid scored another basket 40 seconds later before missing a three-pointer.

He was subbed out when Gasol re-entered the game with 8:44 left in the half. Gasol stayed in the game once Embiid returned with 4:06 before intermission. But the Sixers center scored 14 seconds later after posting up Pascal Siakam.

Embiid had nine points in the first half on 3-for-6 shooting to go with making 3 of 4 foul shots. He spent more time in the paint than on Nov. 25. On this night, Raptors starting center Marc Gasol and backup center Serge Ibaka both had first-half foul trouble. Gasol had two in the first quarter, and Ibaka picked up two of his three first-half fouls in the second quarter.

His third foul came when he knocked Embiid down while the Sixer tried to post him up with 22 seconds left in the first half. Embiid went on to make both foul shots to give the Sixers a commanding 57-42 halftime cushion.

“Just doing my job and attracting attention to help my teammates,” Embiid said. “I did OK. But I didn’t get in any sort of rhythm. I’m happy we got the win.”

Embiid only scored one point in the second half and missed his lone shot attempt. For the game, he didn’t score a single basket against Gasol. Also, he made three critical mistakes late in the game that aided the Raptors’ comeback effort. Toronto pulled within nine points (105-96) after Embiid committed three turnovers in 51 seconds.

Toronto pulled within five points (109-104) on Lowry’s foul shots with 14 seconds left.

Lowry got into a verbal altercation with a spectator who heckled him after the game. The tough point guard told the man, “Come see me! ... I live at 20th and Lehigh. Come see me!”

“He talk too much,” Lowry said of the fan. “I don’t know him, but he ain’t worth my time.”

The five-time All-Star was asked if he’s surprised that he doesn’t get treated well when in Philadelphia.

“I don’t care,” Lowry said. “This is Philadelphia. I respect it. I love it. When I come home ... I am going to be here. So if they got a problem, they can find me.”