It seems that is permissible to pray for a non-muslim who is alive, but if they are already dead, then no.
Lets get the easier one out of the way, in Qur'an 9:113 (At-Tawbah/Repentance):
It is not for the Prophet and those who have believed to ask forgiveness for the polytheists, even if they were relatives, after it has become clear to them that they are companions of Hellfire.
So no, you may not pray for a non-muslim who is already dead.
Now onto the non-muslim who is alive. It is accepted that you may pray for his or her guidance to the right. I will provide a translated quote about Abu Hurayrah's Mother (and how Prophet Muhammad (PBUH) prayed for her guidance):
"I have not let up in inviting my mother to Islâm but she has always rebuffed me. Today, I invited her again and I heard words from her which I do not like. Do make supplication to Allâh Almighty to make the heart of Abu Hurayrah's mother incline to Islâm."
The Prophet responded to Abu Hurayrah's request and prayed for his mother. Abu Hurayrah said: "I went home and found the door closed. I heard the splashing of water and when I tried to enter my mother said: "Stay where you are, O Abu Hurayrah." And after putting on her clothes, she said, "Enter!" I entered and she said: "I testify that there is no Allâh but Allah and I testify that Muhammad is His Servant and His Messenger."
NOTE: In case you feel my answer is not relevant, here is my thinking: I stretched your quote to be a "prayer". And I want to say in atleast one of these cases (Qur'an 9:114) they are not even a prayer, just request to Allah for mercy or forgiveness.