The COVID-19 outbreak spurred unplanned closures and transitions to online classes. Physical environments that once fostered social interaction and community were rendered inactive. We conducted interviews and administered surveys to examine undergraduate STEM students’ feelings of belonging and engagement while in physical isolation, and identified online teaching modes associated with these feelings. Surveys from a racially diverse group of 43 undergraduate students at a Hispanic Serving Institution (HSI) revealed that interactive synchronous instruction was positively associated with feelings of interest and belonging, particularly for students of color, while noninteractive instruction reduced social belonging, but was related to more cognitive engagement. Small group and one-on-one interviews with 23 of these students suggest that students derived feelings of connectedness from their instructors, peers, and prior experiences and relied on their sense of competency to motivate themselves in the course and feel a sense of belonging. Two embedded cases of students in physics classrooms are compared to highlight the range of student feelings of connectedness and competency during the lockdown. Findings reaffirm that social interaction tends to support belonging and engagement, particularly for under-represented (Black or African American and Hispanic) racial groups in STEM. STEM instructors who aim to support feelings of belonging and engagement in virtual learning environments should consider increasing opportunities for student–student and student–teacher interactions, as well as taking a flexible approach that validates and integrates student voice into instruction. Future research is needed to further explore the themes of relatedness and competency that emerged as aspects of course belonging.