It can be seen as jealously, but that's the pessimistic view. If you can admit when this has happened to you, I call it just keeping it real.
When your friend gets that promotion that you secretly wanted, you might die a little inside.
When someone preferred your prissy and pretentious neighbor's sweet potato pie over yours, you might die a little inside.
When you see your ex with another person so soon after you, you might die a little inside.
"Every time a friend succeeds, I die a little."