If you are sure that the whole amount of inheritance is unlawful then you are not allowed to utilize any amount of it, but give it to poor in charity through the Marja of Taqleed.
If you know that part of the amount is unlawful, then you are allowed to utilize the portion which is from allowed income.
Wassalam