"Glim" was originally a slang term for a light, candle, lantern, or match.
"Douse the glim" meant to extinguish the light. It seems to have been a pretty common expression throughout the 19th century.
With a little clinical ingenuity, "glim" later also came to mean gonorrhea.