In his response to this issue, Dr. Ahmad As-Suwei` Shleibak states:
“The best is for the family member to fast for a dead person if he/she had some days he/she did not have chance to fast them before death. This is based on the hadith of the Prophet Muhammad (peace and blessings be upon him) that says: whoever dies and he has some days of fasting, his/her wali should fast on his behalf.
If there is none of the family members who can fast for him/her then non-family member can do that with the permission of the family.”