Thomson scored following a good run and cross by Calum Gallagher and Dumbarton goalkeeper Alan Martin produced a fine double save to deny Jean-Yves M'voto.
The Sons doubled their advantage thanks to another fine finish from the 23-year-old forward.
Sam Stanton bundled home a third before Dumbarton added a late fourth through Garry Fleming.
Robert Thomson scored a first-half brace as Dumbarton secured an impressive victory over Raith Rovers.