On most multimeters, when the diode test function is selected, the meter attempts to put out a constant current, maybe 1 mA. The meter measures the voltage and displays it, but usually only up to a certain voltage, maybe 3 V. Anything above that is shown as no connection.
The constant-current generator will work to a higher voltage, maybe 6 V.
For the LED to light, it needs is for the circuit being tested to have a voltage between 3 and 6 V while 1 mA is flowing and you will get the behaviour that you saw.