We are constantly categorizing other people as belonging to our in-group ('one of us') or out-group ('one of them'). Such grouping occurs fast and automatically and can be based on others' visible characteristics such as skin color or clothing style. Here we studied neural underpinnings of implicit social grouping not often visible on the face, male sexual orientation. A total of 14 homosexuals and 15 heterosexual males were scanned in functional magnetic resonance imaging while watching a movie about a homosexual man, whose face was also presented subliminally before (subjects did not know about the character's sexual orientation) and after the movie. We discovered significantly stronger activation to the man's face after seeing the movie in homosexual but not heterosexual subjects in medial prefrontal cortex, frontal pole, anterior cingulate cortex, right temporal parietal junction and bilateral superior frontal gyrus. In previous research, these brain areas have been connected to social perception, self-referential thinking, empathy, theory of mind and in-group perception. In line with previous studies showing biased perception of in-/out-group faces to be context dependent, our novel approach further demonstrates how complex contextual knowledge gained under naturalistic viewing can bias implicit social perception.