Guercy added a career-high 10 assists and Gearhart - who made 4 of 5 from 3-point range and 12 of 13 free throws - grabbed 10 rebounds.
Andrew Drone had 12 points for Rice (9-15, 6-6 Conference USA), which won its third in a row.
UAB (13-12, 9-3) led 73-71 in the second overtime before Guercy scored nine straight to put the game away.
UAB's Tyler Madison made 1 of 2 free throws with six second left, forcing a second overtime.
Robert Brown led UAB with 20 points.