ORLANDO, Fla. -- Elfrid Payton had 19 points, eight rebounds and eight assists to help the Orlando Magic break a nine-game losing streak with a 102-89 victory over the Detroit Pistons on Thursday night.

Evan Fournier scored 17 points and Aaron Gordon had 14 for Orlando, but it was the Magic's backup centers who made the difference in the game.

Bismack Biyombo had 12 points and 13 rebounds, and Marresse Speights scored 16 points as replacements for injured starter Nikola Vucevic.

Tobias Harris scored 21 points for Detroit, which had won five of six. Andre Drummond had 17 points and 18 rebounds, and Ish Smith contributed 13 points, seven rebounds and five assists.

The Magic controlled most of the game, but needed a boost from Speights and a strong fourth quarter defensively to win it.

The backup center scored Orlando's last nine points of the third period to give the home team a 77-71 lead. His 3-pointer on the first possession of the final quarter started a 9-0 run that put the Magic ahead 86-73 with 9:47 left in the game.

Orlando limited Detroit to just 25 percent shooting (5 of 20) in the fourth period and forced the Pistons into four turnovers. Orlando outscored Detroit 25-16 in the quarter.

Gordon's second 3-pointer of the first half gave Orlando a 46-36 lead in the middle of the second quarter, but Detroit responded with a 14-0 run, including eight straight from Smith. The Pistons point guard was too quick for the Magic's switching defense, allowing him to get to the basket or stop for short, uncontested jumpers with little resistance.

Smith also sparked a 12-0 run in the third quarter, scoring eight points and getting two assists.

TIP-INS

Pistons: PG Reggie Jackson, who had a season-high 13 assists in the win over Indiana on Tuesday, suffered a Grade 3 ankle sprain in the third quarter of that game and will miss six to eight weeks. Smith has replaced him in the lineup. . The Pistons have lost four of their last five games against Orlando.

Magic: Gordon returned to the lineup after missing the last five games and seven of the last eight. . Mario Hezonja hit 8 of 12 3-pointers the last time Orlando played Detroit. He is 4 of 17 from behind the line in the five games since. ... The Magic were 17 of 17 from the free throw line, a franchise record for most free throws in a game without a miss.

UP NEXT

Pistons: Host San Antonio on Saturday night.

Magic: Host Miami on Saturday in a rematch of Tuesday's 107-89 Heat victory.