All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is religiously required from the one who consumes unlawful wealth (illicit gain) to invoke Allah the Almighty and ask Him for forgiveness. Such a person should say the Duaa’ (supplication) that is mentioned in the Quran and Sunnah. Allah the Almighty, may answer his invocations even if his earnings are unlawful. He must also immediately repent to Allah from the unlawful earnings.
Although there is a possibility that the supplication of the consumer of unlawful wealth is not to be accepted, there is also another possibility that Allah the Almighty will accept it because he is the Most Merciful. Moreover, Quran and Sunnah did not indicate that his Duaa’ cannot be accepted, but they indicate that his Duaa’ is unlikely to be accepted. Therefore, the scholars stated that Allah might accept his Duaa’ by His Mercy; Al-Qurtubi said about the interpretation of the verse: {Allah said], "O messengers, eat from the good foods and work righteousness. Indeed I, of what you do, am Knowing.} [Quran 23:51]; and he mentioned the Hadith: “… But his food is unlawful, his drinks are unlawful, and his clothing is unlawful, and he has been nourished by what is unlawful. So how can his Duaa’ be accepted?" After this he said: “The saying of the Prophet, sallallahu ‘alayhi wa sallam, “So how can his Duaa’ be accepted?"; means that it is highly unlikely that his supplication be accepted; which means that he does not deserve to have his Duaa’ accepted. However, Allah may accept his Duaa’ our of His Kindness, Grace, and Generously.” [End of quote]
Ibn Abd Al-Malik, from the Hanafi School of jurisprudence, said in Sharh Al-Masabih: “So how can his Duaa’ be accepted?"; this indicates that his Duaa’ is unlikely to be accepted, but not impossible.” [End of quote]
Ibn Rajab said in Jami’ Al-‘Uloom wa Al-Hikam: “The saying of the Prophet, sallallahu ‘alayhi wa sallam: “So how can his Duaa’ be accepted?”, is a question that indicates surprise and unlikeliness, but it does not explicitly indicate the impossibility of the acceptance of his Duaa’ and that it cannot be accepted at all. It is concluded from this that abundantly earning what is forbidden and being fed with it are among the impediments that prevent the Duaa’ from being accepted. Also, there may be something that prevents this impediment from preventing the acceptance of the supplication.” [End of quote]
This Duaa’ is one the greatest supplications, so it is recommended to invoke Allah by it in prostration.
Allah knows best.