Can a postdoc write a letter for someone applying for a postdoc? I'm a PhD student currently applying for postdocs and while I have secured my first and second letters of recommendation from faculty, the professor that had agreed to write me my third has unfortunately passed away recently.

I don't have a fourth professor sufficiently familiar with my research to write a strong recommendation letter. If I were to ask one, it would be one of those "good but also kinda filler" letters written by someone who knows me but doesn't know me.

Alternatively, I could ask a postdoc I worked closely on several projects for a letter. He would be able to write a strong letter, but of course that's still not ideal because he's a "mere" postdoc.

Which one would you recommend? A good letter written by a professor mostly as a favor, or a strong one written by a postdoc?

(There are similar questions on this site, but those concern Master students requesting letters from a postdoc when applying to a PhD position. Since a postdoc is still above a PhD student, the context is different, so the answers there don't necessarily apply here.)

EDIT: I'm applying for postdocs in Europe and North America.
In every situation I know of, a postdoc would be allowed to write you a letter.  In general it's not a good idea to get a letter from a postdoc when you're applying for a postdoc.  But that doesn't mean it's never the best option.  A strong letter from a postdoc isn't going to actively hurt your application, it's just not going to help you the same way a strong letter from someone with more experience would.  The main problem is that a postdoc doesn't yet have the perspective to see what makes people successful in the long run and doesn't have a broad enough pool to compare you to.  It matters here whether the postdoc has great work and is relatively well-known, and it also matters how far out from PhD the postdoc is.  There are strong senior postdocs in my field whose opinion I would give a lot of weight to.  I don't know all the details, but it sounds like asking the postdoc might be a reasonable decision in your unfortunate situation.

All that said, I think your question misunderstands the purpose of letters in a way that's quite common among graduate students.  It's not necessary that your letter writers all know you so long as they know your work.  It's better to have a letter from an important figure in your field who understands your work, than to have a letter from someone local who knows you really well.  I always encourage graduate students to try to get one letter from someone at a different school.  If you gave a talk somewhere and had a productive conversation afterwards with the person who invited you, that person might be an excellent choice for a third letter.  It's pretty late in the process right now, so it might not be possible to get a third letter from an outside expert in a timely fashion, but in general it's something graduate students should be looking for.  You should not be getting letters from local professors who know you from class but who can't understand your work.