In theory with 5v on the anode and 24v on the cathode the LED is reverse biased and no current will flow. In practice you might well be exceeding the reverse breakdown voltage of the LED which will break it. LEDs tend to have quite low reverse breakdown voltages so check the spec of the device you're using.