Relationships between conspecifics are influenced by both ecological factors and the social organization they live in. Systematic variation of both—consistent with predictions derived from socioecology models—is well documented, but there is considerable variation within species and populations that is poorly understood. The mountain gorilla (Gorilla beringei) is unusual because, despite possessing morphology associated with male contest competition (e.g., extreme sexual dimorphism), they are regularly observed in both single-male and multimale groups. Both male–female and male–infant bonds are strong because males provide protection against infanticide and/or predation. Risk of these threats varies with social structure, which may influence the strength of social relationships among group members (including females and offspring, if females with lower infant mortality risk are less protective of infants). Here, we investigate the relationship between group structure and the strength of proximity relationships between males and females, males and infants, and females and offspring. Data come from 10 social groups containing 1–7 adult males, monitored by the Dian Fossey Gorilla Fund's Karisoke Research Center in Volcanoes National Park, Rwanda. After controlling for group size and infant age, association strength was similar for male–female pairs across group types with both dominant and nondominant males, but male–infant relationships were strongest in single-male groups where paternity certainty was high and animals had fewer social partners to choose from. The male:female and male:infant ratios better predicted both male–female and male–infant associations than the absolute number of males, females, or infants did. The fewer the number of males per female or infant, the more both pair types associated. Dominant males in groups containing fewer males had higher eigenvector centrality (a measure of importance in a social network) than dominant males in groups with more males. Results indicate that nondominant males are an important influence on relationships between dominant males and females/infants despite their peripheral social positions, and that relationships between males and infants must be considered an important foundation of gorilla social structure.