Top scorer Thomson found the bottom corner from 20 yards after 84 minutes for his fifth league goal of the season after Walsall had twice hit the woodwork.
The hosts created the better chances throughout and Liam Gordon went close just after the half-hour, sweeping Isaac Hutchinson’s pull-back on target only for Matty Foulds to clear the ball off the line.
Harrogate’s only first-half chance of note saw Sam Folarin’s near-post shot force a smart save from Saddlers goalkeeper Owen Evans.
After the break, Walsall midfielder Brandon Comley blazed over a great chance before Tom Knowles and Hutchinson both struck the base of the upright from 18 yards within minutes of each other.
Donervon Daniels also headed a corner wide from close range and Walsall were punished six minutes from time as they allowed Thomson far too much space and time to drill home the late winner.