godan verb (-mu), intransitive verb
stray into; wander into; lose one's way and enter
Describes accidentally entering a place while lost, or wandering into an unfamiliar area.
森の中に迷い込んでしまった。
I ended up straying into the forest.
知らない町に迷い込んだ。
I wandered into an unfamiliar town.
Standard kanji spelling.
Search-only form; not a standard spelling.
迷う is a general verb for being lost or indecisive; 迷い込む specifically adds the nuance of entering somewhere as a result of being lost.
Compound of 迷い (continuative form of 迷う 'to lose one's way') + 込む 'to go into'. The exact historical derivation is straightforward.