Temple easily surpassed the 23 points he tallied twice previously in his NBA career, helping the Kings snap an eight-game losing streak.
Temple sat out two of the Kings' previous three games as part of coach Dave Joerger's plan to bench at least two veterans in each game so younger players get more of an opportunity to play.
The Kings, who entered the game with the worst record in the NBA, rested Zach Randolph and George Hill against Orlando.
Evan Fournier had 22 points to lead the Magic, who lost for the second time in a four-game stretch that had featured impressive victories over the Minnesota Timberwolves and the Boston Celtics.
Up by just one at halftime and 66-64 in the sixth minute of the third quarter, the Magic went on a 13-4 run that opened their first double-digit lead of the game at 79-68. Jonathon Simmons had six points and Elfrid Payton five in the pull-away.
The Kings creeped within 82-77 by the third quarter's end, then went ahead 94-93 with 5:15 to go after back-to-back 3-pointers by Temple.
Sacramento took the lead for good, 99-97, on another Temple 3-pointer with 2:42 remaining. He added an 18-footer with 1:31 to go and two free throws with 23 seconds left to ice the win.
The Magic did not score from the 3:58 mark until Payton made a meaningless layup at the final horn.
Willie Cauley-Stein had 21 points and nine rebounds, Buddy Hield added 13 points, and Skal Labissiere contributed 10 points and nine rebounds for the Kings, who had begun a six-game trip with losses to the Memphis Grizzlies and the Charlotte Hornets.
Payton had a game-high seven assists to complement 21 points, and Aaron Gordon pulled down a game-high 12 rebounds to go with 16 points for the Magic, which is now tied with Sacramento for the fewest wins in the NBA with 14.
Fournier scored nine of his 22 points in a 16-4 first-quarter run that allowed the Magic to overcome an early seven-point deficit.
--Field Level Media
Sacramento | Orlando | |
Garrett Temple 34 | Scoring | Evan Fournier 22 |
Vince Carter 6 | Assists | Elfrid Payton 7 |
Willie Cauley-Stein 9 | Rebounds | Aaron Gordon 12 |
Skal Labissiere 4 | Free Throws Made | Evan Fournier 6 |
Buddy Hield 4 | Steals | Elfrid Payton 3 |
Willie Cauley-Stein 5 | Blocks | Bismack Biyombo 4 |
Team | Points | FG% | 3PM-3PA | FTM-FTA | Assists | Rebounds | Blocks | Steals | Turnovers |
Sacramento | 105 | 49.4 | 8-26 | 11-13 | 24 | 44 | 11 | 9 | 14 |
Orlando | 99 | 43.4 | 11-31 | 16-19 | 23 | 40 | 4 | 9 | 17 |