The co-occurrence of depression and envy is both plausible and empirically established. However, little is known about the mechanisms underlying this correlation. An account is proposed according to which low self-esteem in depressed individuals leads to upward social comparison and thus makes envy more likely. This effect should frequently occur in online social networks like Facebook because they allow for easy impression management and hence provide high comparison standards. In a quasi-experimental online study, depressed and non-depressed participants indicated their self-esteem and were then presented with specifically set up Facebook profiles that were either attractive or unattractive. Participants were asked to compare themselves to the profile owner and to report their resulting feelings of inferiority and envy. Depressed participants were more envious, especially after seeing the attractive profile. Envy was associated with higher self-reported inferiority and also correlated negatively with self-esteem. The connection between depression and envy is demonstrated with an experimental elicitation of envy for the first time. The results strongly suggest that low self-esteem and consequent feelings of inferiority play a crucial role in depressed individuals' elevated levels of envy. Practical implications and limitations are discussed.