Don’t engage a compliment built on an insult of someone else. The person who is quietly weighing you against somebody else and finding you superior isn’t doing you any favors by telling you that. If you allow their verdict to tickle your ears they’ve got you. Plus, some other person is getting diminished, unchallenged by you, and that’s not a win either.
No, don’t engage. Make it clear that negative chatter will find no audience with you.
My mother would have none of this kind of behavior. When I, a self-righteous pre-teen, complained about my father in the hopes of some maternal sympathy, that he was making me wash the dishes when it was indisputably my brother’s turn, she would barely look up from her ashtray and intone, “So do the dishes.” No amount of incredulous gasping moved the needle. She never engaged.
You shouldn’t either.