I've been thinking and thinking about this.
Look at this image:
(Imagine both the resistor and LEd were in parallel with the capacitor, otherwise the LED will be overloaded)
By doing this I've managed to create a circuit that, when it loses power, makes the LED fade. However, I wanted to find a way in which the LED will only be powered when the circuit doesn't have a power supply (other than the capacitor). I've been thinking about logic gates, diodes, etc., but can't figure out a way in which it would work. Is there any?