The win snapped a two-game losing streak for the Knights, which were playing their first game at home since Nov. 17.
Brandon Goodwin added 11 points and 11 rebounds off the bench for UCF.
The Knights led by just five at halftime, but used a 14-0 run midway through the second half to take control of the game.
There were 47 fouls in the game, but both teams struggled from the free throw line. UCF shot just 55 percent and Stetson 50 percent.
The Knights had just four fast-break points in the first half, but started to get out and run in the second half, which began to spread the Hatters out defensively.
UCF finished with just 10 fast-break points for the game, but had eight of those the final 20 minutes.
UCF led by as many as 13 points in the first half, but struggled to keep a scrappy Hatters team from getting in the paint, and led just 39-34 at halftime.
Stetson was within 13-12 early before a 19-7 Knights spurt gave them a 32-19 cushion.
But the Hatters got a combined 21 first-half points out of Graham and Andrews, who sparked an 11-3 run to get them back into the game.
It could have been closer, but Stetson went just 6 of 12 from the foul line in the opening 20 minutes.
UCF wasn't much better, though, connecting on only 9 of its 15 free-throw attempts in the half.