Do I need to mention having survived a life-threatening illness when applying for a new academic position? Do I have to (or is it wise or unwise) to mention having survived a life-threatening illness (such as cancer, a (early) heart attack, etc when applying for a new (non-leading) academic position?

Assume that my health condition is now good enough (and the past health troubles are not obvious from my outward appearance) such that from a medical point of view nothing speaks against my further persuing my academic career and interests. 

Nevertheless, due the specific medicaments I have to take for the rest of my life and some remnants of the past health issues, there might be times my productivity might slightly be lessened. Also, even though the probability is not very high, it can in principle not be 100% excluded that the illness will come back at some point.

Of course I would not mention this in a written application, but should I talk about my health condition in the context of an interview or before things are getting serious and it comes to signing the contract?

BTW I currently live in Germany
If you think it helps explain a work or productivity gap in your career, I would mention it and I would do so in writing rather than let your prospective employers speculate. Because overcoming a major medical challenge can help you align your priorities and strengthen you in other ways, doing so can definitely be done in a way that leads one to conclude that it is a strength, not a weakness, of your candidacy.

If your previous condition is not relevant in these ways, I don't think you have any obligation to bring it up. Sure, your illness might return but nobody is 100% immune from serious illness impacting their ability to work or be productive. For that matter, severe chronic illnesses that unambiguously affect productivity (e.g., cramps, migraines, etc.) are simply not the kind of thing that people bring up while interviewing and candidates have no responsibility to do so.

Reminding prospective employers of this can open to the door to (illegal) discrimination based on your medical history and I don't think you are helping either yourself or your prospective employers by bringing it up. When you take an offer, it might be good to let your future department know about your history as background but you might even let this just be raised socially.