"Can I get away with it?" reeks of DIY (no offense).
Is there ANYWHERE else you could place it and not have to "...get away with it.."?
Say, behind the bedroom door?
You get your closet, inspector is satisified code-wise, and the bedroom door is usually only closed at night when it's dark or when the occupants are otherwise "distracted" from the panel behind the door:wink: