‘Uqbah b. ‘Āmir Al-Juhanī – Allāh be pleased with him – once passed by a man who looked like a Muslim, so he greeted him with salām, and he replied, “And upon you [be peace] and the mercy of Allāh and His blessings.” A boy informed him, “He is a Christian!” So ‘Uqbah got up and followed the man, caught up with him and said, “The mercy of Allāh and His blessings are upon the believers; however, may Allāh give you a long life, and make plentiful your wealth and offspring.”

Al-Bukhārī, Al-Adab Al-Mufrad. Shaykh Al-Albānī grades its chain of narration ḥasan in Saḥīḥ Al-Adab Al-Mufrad p444, and notes, “In this narration this illustrious Companion indicates that it is permissible to supplicate for someone to have a long life, even if he is an unbeliever, and so [this can be done for] a Muslim a fortiori…However, the supplicant should make sure that the unbeliever is not an enemy of the Muslims. It is also taken from this [narration] that such an unbeliever can be commiserated with what has been mentioned therein [i.e. the believers are the ones who will receive the mercy of Allāh and His blessings].”