I had a brother who worked for a foreign company, and he passed away, and his company gave us some money from his life-insurance. I know that this money is haraam, so I put it in a separate account in the bank and I use it for charitable purposes only. I do not use a single pound of it for any personal interest. But now I am in great need of the money for an important matter that cannot be delayed, and I have a shop that I am going to put up for sale, but right now I cannot sell it. Can I use the insurance money, temporarily, to meet my needs so that I will be able to sell the shop and put back what I took from the insurance money? Or is that not permissible?

Praise be to Allah.

Commercial insurance of all types is haraam, because it involves riba,
gambling and ambiguity, as we have explained in the answer to question no.
8889. The Muslim should avoid it as much as he can.
But if he cannot do that, and he is obliged to take out insurance, then he
is entitled to take of it as much as he paid in; if there is anything more
than that, then he has to get rid of it by spending it on charitable
causes. 

This is what is to be said to the owner of the money, and this is the basic
principle with regard to the ruling on this issue. 

But it is a different matter when the money is transferred to the heirs,
provided that the money is not haraam in and of itself; rather it is haraam
because of the way in which it was acquired. This includes what the question
is asking about here, which is acquiring money as a result of an insurance
contract. Riba, gambling and ambiguity have to do with the money that is
haraam because of the way in which it is acquired; the money is not haraam
in and of itself. If the money is haraam because of the way in which it is
acquired, the sin is only on the one who acquired it and there is no sin on
the one who engages in a transaction with the one who acquired it, such as
buying, selling, gift-giving, or hosting a guest. 

The evidence for that is the fact that the Prophet (blessings and peace of
Allah be upon him) used to engage in transactions with the Jews in Madinah,
buying and selling, and he used to eat with them, even though Allah, may He
be exalted, had described them as consuming riba and taking people’s wealth
unlawfully. 

Based on that, when this money that was acquired by haraam means was
transferred to the heirs, it became halaal for them. This is the view of the
Maalikis and was regarded as more correct by Shaykh Ibn ‘Uthaymeen (may
Allah have mercy on him). 

Al-‘Allaamah Muhammad ‘Ulaysh al-Maaliki (may Allah have mercy on him) said:
There is a difference of opinion concerning wealth that was acquired by
haraam means, such as riba and invalid transactions. If the one who acquired
it in that manner dies and leaves it behind, is it permissible for the heirs
– which is the correct view – or not? As for wealth that is haraam in and of
itself, and its rightful owner is known, such as wealth that was stolen or
taken by force, it is not permissible for the heir.

End quote from Manh al-Jaleel Sharh Mukhtasar Khaleel (2/416) 

Shaykh al-‘Uthaymeen (may Allah have mercy on him) was asked: 

If
a person inherits wealth from someone, and he knows that part of this
wealth, such as ten thousand or twenty thousand – is obviously haraam riba,
but he does not know about the rest, or it is mixed, then what should he do
with the riba that is obviously haraam? 

He
replied: There is nothing wrong with it, and it is halaal for him, because
he took possession of it in a permissible manner, namely inheritance. But if
you know that this is the property of a particular person, and that the
deceased took it by force, then in that case it is not permissible for you.
But if it was haraam because of the way in which it was acquired, such as
riba and the like, then in this case there is nothing wrong with it.

End quote from Liqaa’aat al-Baab al-Maftooh (213, question no. 12) 

We
have stated that previously on our website in several answers. Please see
the answers to questions no. 20709,
39661, 85419 and
87747

Thus you will know that this wealth that the company gave to you should be
divided among the heirs of your brother according to the shares of
inheritance allocated to them by sharee‘ah. Hence you may ask permission to
borrow or use the money from its rightful owners. 

Please see also the answer to question no. 180520

And Allah knows best.