Hartley finished with 10 points and 13 points for the Runnin' Bulldogs (11-10, 3-4 Big South Conference), who snapped a two-game losing streak. Donta Harper scored 10 points and had six rebounds.
Gardner-Webb led by as many as 12 points in the first half, but the Runnin' Bulldogs saw their lead vanish in the second half. The Keydets tied the game at 34-all on Rodney Glasgow's layup with 18:26 left to play.
But VMI (9-10, 4-3) was unable to pull ahead, as Gardner-Webb answered with a 15-2 run that was capped by Jarvis Davis' two free throws with 9:01 remaining.
Maryland point guard Melo Trimble, considered a lock to leave the program before struggling in the second half last season, has withdrawn from the NBA draft and will return for his junior season.
Louisville's Chinanu Onuaku, who recently underwent a medical procedure to correct a heart rhythm issue detected during the combine, will keep his name in the NBA draft pool.
Andrew White III will return to the Nebraska men's basketball team next season after removing his name from the NBA draft.