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 is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
If A gives some money which is obtained from Ribaa (interest and usury) or lottery to B, and B is not a poor person, then it is not permissible for him to accept this money as it is ill-gotten money. Therefore, this money should be spent on the general benefit of Muslims, among whom are the poor and destitute. Moreover, if B knew the reality of this money when he took it or he came to know after he took it, then he should spend what he has taken in the general benefit of Muslims but he should not return it to A as this money does not belong to him [A].
The above applies to the case when A gives to B from the money obtained from Ribaa or lottery itself. However, if A has other lawful money and it is mixed with some unlawful money, then the scholars have different opinions on this issue; for more benefit, please refer to Fatwa 87473.
Allaah Knows best.