Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- Death benefit or the death compensation is that this benefit is to be given to those whom the deceased nominated whilst he was still alive.
2- If he did not nominate anyone, then the insurance company gives it to his wife.
3- If there is no widow, then it is to be given to his minor sons and unmarried daughters.
4- If there are no children, then it is to be given to his parents, and so on.
Answering your question, the Fatwa Center at Islam Q & A, states:
What we found out about the death benefit or the death compensation is that this benefit is to be given to those whom the deceased nominated whilst he was still alive.
If he did not nominate anyone, then the insurance company gives it to his wife [his widow]. If there is no widow, then it is to be given to his minor sons and unmarried daughters.
If there are no children, then it is to be given to his parents, and so on. Concerning the details of that, reference is to be made to the insurance committee.
The amount of this benefit is the salary for the month in which the person died, and the salary for the two following months, for a person who died whilst still working, or an amount equal to his pension for the month in which he died and the two following months, if he was receiving a pension.
If this compensation came because the deceased was an employee, and part of his salary was deducted for insurance, then it is part of the estate, and is to be divided among all the heirs, regardless of the system followed by the insurance department, because in fact it is not a benefit paid by them.
If we assume that this benefit did not come from the accumulation of money deducted from the employee’s salary, and was in fact a benefit paid out because of the deceased’s employment service, then it is also the result of his work and efforts, so it is to be included with what he earned during his lifetime, and is inherited from him.
We read in Al-Maws`ah Al-Fiqhiyyah, (11/208):
“The Shafi`is clearly stated that also to be included in the estate is anything that is added to the property of the deceased after his death as a result of something that he did during his lifetime, such as game that fell into a trap that he set up whilst he was alive, because his setting up of the trap to catch the game is the cause of it coming into his possession, or he died and left behind wine that turned into vinegar after his death.”
Almighty Allah knows best.
Source: www.islamqa.info