In Ontario(If that is where your installation is) you cannot run DC & AC in same raceway.
CSA rule 46-108 (3) "Say's no WAY"
and as iwire noted NEC 700-9 (B),(1),(2),(3),(4)
Basically say's Junction Box attached to fixture (key word "attached),in fixture, and in your case Battery pack.