Titus Shelton added 17 points and six rebounds for the Mustangs (5-12, 2-5 Big West Conference). Cal Poly trailed by 16 points with 9:08 remaining but held the Aggies to just one basket and five points the rest of the way to win their second straight after a seven-game losing streak.
Joe Harden had 16 points and 11 rebounds to lead five Davis players in double figures. The Aggies (9-11, 4-3) went more than eight minutes without a field goal in the second half and missed a chance to pull within one game of first-place Long Beach State, which lost to UC Riverside.
Thomas, the Mustangs' leading scorer, didn't take a shot the entire first half and didn't score until nearly five minutes were gone in the second half. But his first 3-pointer with 1:19 left to play capped a 19-2 run and gave Cal Poly its first lead of the game, 73-72.
Vince Oliver scored on a reverse layup for Davis, but Thomas sank another shot from beyond the arc to make it 76-74. After the two teams traded free throws, the Aggies had one final chance, but Oliver shot an airball that Keeler caught underneath the basket as time ran out.
The Mustangs opened the season 3-5 but lost their next seven before beating Pacific 76-60 in Stockton on Thursday. They fell behind by 12 in the first half against Davis and were reeling after Mark Payne's steal and breakaway layup gave the Aggies a 70-54 lead midway through the second half.
But John Manley and David Hanson came off the bench to score five points apiece and Keeler added four to spark Cal Poly's comeback. Thomas followed with back-to-back 3-pointers to silence the Davis crowd while giving the Mustangs their first consecutive wins since beating Davis and Pacific last January.
Shawn Lewis had 13 points for Cal Poly, which won its fifth straight over the Aggies and leads the all-time series between the two teams 27-10.
Dominic Calegari scored 15 points and Oliver added 11 points for Davis, which led 41-37 at halftime.