We regularly infer other people’s thoughts and feelings from observing their actions, but it remains unknown how this ability contributes to successful social behavior and interactions. We show that neural activation patterns during social inferences obtained in the laboratory predict the number of social contacts in the real world in three community samples (total n=126) and a population with autism (n=23) (social network index, SNI). Cross-validated predictions were localized selectively to the right posterior superior temporal sulcus (pSTS) and were specific for social inferences, not nonsocial ones. Moreover, the multivariate pattern of brain activation during social inferences generalized across participants in the neurotypical and autism group (cross-sample prediction). Brain activations in pSTS also predicted autism-like trait scores (AQ, SRS-2) in neurotypical individuals and symptom severity scores (ADOS SA) in the autism group. These findings indicate that neural activations produced while thinking about other people’s mental states predict variance in other indices of social functioning - beyond the number of real-world social connections. Together, these findings point towards social inference as a latent variable that comes into play relatively ubiquitously in real-life social behavior. The results also demonstrate the potential of using localized, process-specific neurobiomarkers of cognitive abilities that contribute to social behavior as robust predictors of people’s social functioning in the real world.