All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
A Muslim is allowed to gift all living and dead Muslims the reward of his good deeds and acts of obedience. They will be benefited by that and the reward will reach them – Allaah Willing. Thus, it is permissible for this man to gift this woman the reward of charity, reciting the Quran, supplication, and other good deeds. For further information, see Fataawa 91963 and 86828. Having had an illicit relationship with that woman does not prevent him from gifting her the reward of good deeds.
However, he must sincerely repent to Allaah The Almighty of this illicit relationship with her. He should beware of being too tolerant in dealing with non-Mahram women; surely, this is a great door of temptation. It was authentically narrated that the Prophet, sallallaahu ‘alayhi wa sallam, said: "Beware of beguilements of this world and those of women for the first temptation that befell the children of Israel was through women." [Muslim]
Allaah Knows best.