Reference: Fataawa wa Rasaa.il Mukhtaarah – Page 551
Question: Is it permissible for me to say: “O Allaah! Just as you have bestowed this blessing upon such-and-such, so bestow upon me the same”?
Response: There is no harm in [making] this supplication which the questioner has mentioned; And this is from requesting that which is good for oneself – and it is called envy; It is that a person envies other than himself over something, and thereby wishes that he attains for himself what the other person has attained.
However, that which is prohibited is to be jealous – whether that be over something in the religion or the worldly life. And jealousy is when a person hopes for the cessation of a blessing from his brother [in Islaam] and [instead] for him to receive that blessing.
And Allaah [alone] has the Complete knowledge [of all affairs].