Cartwright made his move at the two-mile mark and passed Thompson as both began their ascent up "Agony Hill."
On the descent, Cartwright pushed ahead by 10 seconds and increased his advantage to 20 seconds at the 2 1/2-mile point before winning the race in 17 minutes and 21 seconds.
Thompson was second in 17:50, while Pasadena Poly's Michael Caughron was third in 18:05.
It became clear by the one-mile marker that either Cartwright or Thompson would win the race, as the duo broke ahead of Caughron by about 10 seconds and were significantly ahead of the rest of the pack.
Thompson jumped out to a lead after 50 meters to start the race and remained ahead of Cartwright and Caughron.
Thompson's teammates stayed close to their leader, as Aaron Sugimoto finished fourth (18:13) and James Bradley took fifth (18:16).
The Rebels' Alan Yoho (seventh, 18:26) and Elias Ellison (eighth, 18:35) closed out Prep's scoring, while fellow Rebels Eli Weinstein (ninth, 18:37) and Alex Guzner (12th, 19:48) affected their opponents' scoring.
"Our team goal was to have our seventh guy finish ahead of everyone else's No. 2 guy," Thompson said. "We got close."
As for the girls, the Rebels finished fourth with 99 points, behind Mayfield (31), Chadwick (51) and Poly (73).
"We're used to finishing in the top two, so this is definitely different," Prep Coach Michael Roffina said. "We have some things to work on, but we'll improve."
Sarah Yoho was Prep's top runner, taking eighth in 22:12, slightly ahead of teammate Kate Evans (ninth, 22:17).
"We're a team of mostly sophomores, so this was a learning experience for all of us today," Yoho said. "This course was really difficult."
Audrey Levy (23rd, 24:53), Natalie Rose Schwartz (27th, 25:11) and Grace Broyles (32nd, 26:01) rounded out Prep's scoring.
"We don't want to be running our best so early in the season," Evans said. "We still have a lot of time to keep on improving."
Pasadena's Poly's Evan Gancedo won the girls race in 20:54, ahead of Chadwick's Lauren Ouye (21:30) and Mayfield's Lauren Joseph (21:44).