Tuning magnetotransport in a compensated semimetal at the atomic scale