The story
Before electric light, working past dark meant burning oil in a lamp. In 1635 the poet Francis Quarles wrote of spending “our mid-day sweat, or mid-night oyle,” the first known use. English already had a stiff word for it, “elucubrate,” meaning to work by candlelight. The lamp phrase won easily.