I doubt that there's any interface between the engine lid sensor and the oil level gauge.
I'd be more inclined to think that, if there is really a connection between slamming the lid and the warning light going off, that the warning light might might be caused by a poor oil-level sensor electrical connection and the shock of the engine lid being slammed might have improved that connection. 
Pure speculation on my part, but ...........Smiley


--

fritz