You have to advise them and warn them of the evil consequences of dealing in haraam things and earning money from haraam sources. You should cooperate with your brothers in reminding them and warning them of the punishment of Allaah and how severely He deals with those who disobey Him. You should tell them that the pleasures of this world are insignificant, and that the Hereafter is better and more lasting. If they respond, then praise be to Allaah, and they will become thereby your brothers in Islam. Then you should advise them to restore the rights of those whom they have wronged, if they know who they are, and to follow up bad deeds with good, so that Allaah may accept their repentance and turn their bad deeds into good. In that case it will be permissible for you to mix with them as brothers and to eat their food, and to accept their donations for building and furnishing the mosque, etc, because by repenting and restoring people’s rights it is possible that they may be forgiven for what they did in the past, because Allaah says concerning those who deal in riba [usury] (interpretation of the meaning):
“So whosoever receives an admonition from his Lord and stops consuming Ribaa, shall not be punished for the past”
If they refuse to heed the advice and reminders, and they persist in their haraam actions, then you have to forsake them for the sake of Allaah, and not accept their invitations or accept their donations, as a rebuke to them, and in the hope that they will give up their evil ways.
And Allaah is the Source of strength.