Social behavior includes a variety of behaviors that are expressed between two or more individuals. In humans, impairment of social function (i.e., social behavior and social cognition) is seen in neurodevelopmental and neurological disorders including autism spectrum disorders (ASDs) and stroke, respectively. In basic neuroscience research, fluorescence monitoring of neural activity, such as immediate early gene (IEG)-mediated whole-brain mapping, fiber photometry, and calcium imaging using a miniaturized head-mounted microscope or a two-photon microscope, and non-fluorescence imaging such as functional magnetic resonance imaging (fMRI) are increasingly used to measure the activity of many neurons and multiple brain areas in animals during social behavior. In this review, we overview recent rodent studies that have investigated the dynamics of brain activity during social behavior at the whole-brain and local circuit levels and studies that explored the neural basis of social function in healthy, in brain-injured, and in autistic human subjects. A synthesis of such findings will advance our understanding of brain mechanisms underlying social behavior and facilitate the development of pharmaceutical and functional neurosurgical interventions for brain disorders affecting social function.