Maroon (in the sense of “being stranded”) comes from an old Spanish word cimárron (via French) which used to mean “wild”. Although this original Spanish word is no longer in use, it comes from cima meaning “summit (such as of a mountain)” — which is still a common word. Wild animals, after all, stayed at the tops of the mountains since humans encroached from the bottom.
The -m- (finishing up cima and starting maroon) is the only surviving commonality between both words today.