How to close a circuit using a level
Pinball machines used to use a tilt bob. Image from here



The bob hangs down in the hole in the bracket, and tilting off vertical by more than a certain amount (adjustable by the vertical position of the bob) will allow it to touch the inside of the hole. 



You can do a similar thing with an accelerometer, but it would probably require a cellphone style 3-axis unit, since \$\sin(5\cdot2\pi/360) \gt \gt 1-\cos(5\cdot2\pi/360)\$.