The purpose of this study is to investigate how competitive or cooperative social settings influence person perception. More specifically, we explore conditions under which compensatory judgment based on competence and warmth is triggered, with a focus on the mediational role of social comparison-based emotions: admiration, envy, pity, and contempt. We hypothesized that the type of self-target relationship, which is either competitive or cooperative, determines the nature of emotions aroused by a competent or incompetent target person, which in turn influences the evaluation of this target. A total of 124 undergraduates formed impressions of a single target person depicted as academically competent or incompetent under one of three experimental conditions in which they expected to compete, cooperate, or not to interact with the target. We found a typical compensation effect where high-competence targets were judged as less warm than low-competence targets in a one-target situation regardless of the status of the self-target relationship. Moreover, we obtained clear evidence for the meditational role of upward comparison-based emotions: For the high-competence target, envy facilitated the compensation effect but admiration attenuated it. The role of downward comparison-based emotions (i.e., contempt and pity), however, remains unclear. The limitations of the role of self-target relationships and emotions in compensatory judgment are also discussed.