Answer:
I would argue that militarism contributes to imperialism, not the other way around. But I guess that imperialism could lead to the growth of armies in that it allows them to expand their forces through the natives from the area that they're imperializing.
A good example of this would be the British East India Company. British imperialism was especially prevalent in India during the 18th/19th century, and during that time they were able to create a presidency armies which were mostly made up of Indian sepoys.