Using US National Education Longitudinal Study (NELS) data, we explore how parental education and primary students' perceptions of their teachers interact to impact students' self-efficacy in mathematics. Our results demonstrate that students tend to have higher self-efficacy if they perceive that their teacher promotes the importance of mathematics. This relationship holds regardless of parental education, though it is strongest for children of parents without a university education. Children of less educated parents also tend to have lower self-efficacy if they attend private schools, which typically have high average parental socio-economic status (SES). School type has no discernable impact on children of university-educated parents. These findings are highly relevant to the Canadian context, which is characterized by schools being stratified by SES and the high importance of STEM education for occupational outcomes.