Social context plays an important role in human communication. Depending on the nature of the source, the same communication signal might be processed in fundamentally different ways. However, the selective modulation (or "gating") of the flow of neural information during communication is not fully understood. Here, we use multivoxel pattern analysis (MVPA) and multivoxel connectivity analysis (MVCA), a novel technique that allows to analyse context-dependent changes of the strength interregional coupling between ensembles of voxels, to examine how the human brain differentially gates content-specific sensory information during ongoing perception of communication signals. In a simulated electronic communication experiment, participants received two alternative text messages during fMRI (". happy" or ". sad") which they believed had been sent either by their real-life friend outside the scanner or by a computer. A region in the dorsal medial prefrontal cortex (dmPFC) selectively increased its functional coupling with sensory-content encoding regions in the visual cortex when a text message was perceived as being sent by the participant's friend, and decreased its functional coupling with these regions when a text message was perceived as being sent by the computer. Furthermore, the strength of neural encoding of content-specific information of text messages in the dmPFC was modulated by the social tie between the participant and her friend: the more of her spare time a participant reported to spend with her friend the stronger was the neural encoding. This suggests that the human brain selectively gates sensory information into the relevant network for processing the mental states of others, depending on the source of the communication signal.