Is it ethical to use a recommendation letter from a deceased professor?
If I cared enough about a person to write a letter of recommendation, I would be pleased to think that one day after I am gone that the person could use my letter for their benefit.
You will possibly benefit from this recommendation and possibly someone else will suffer if you are selected based upon the recommendation; however, competition is not generally considered unethical.
There are no legal questions raised that I can imagine.
It seems unconventional, but not extreme.
My feelings are that it would be ethical to use the letter.
I attach letters of recommendation from Dr W and the late Professor X.
Perfectly reasonable.
The point is, it's courteous to refer to the deceased as the late Professor X to prevent confusion or embarrassment and to avoid unnecessary pain to the bereaved.
If you don't do this, and the widower receives a letter addressed to his wife that assumes she's alive, then has to write back to someone he doesn't know explaining to save your skin, shame on you.
I am in, more or less, your exact situation. My PhD supervisor died of a brain tumor in 2011. However, he did not leave behind a letter for me, nor am I on the market. I think you should be careful of the culture that you are applying in. If the culture demands, usually, that the letter be blind to the applicant, then you should probably not use it unless you state in your cover letter the reason why you have included it. If it's an open system, then you will probably benefit from it unless it's been 5 or 10 years since your recommender's passing. Either way, as the comments say, you should disclose what's going on.