We report on a comparison study of the Monte Carlo packages GEANT4 and FLUKA for simulating neutron production by muons penetrating deep underground. GEANT4 is found to generate fewer neutrons at muon energies above ~100 GeV, by at most a factor of 2 in some materials, which we attribute mainly to lower neutron production in hadronic cascades. As a practical case study, the muon-induced neutron background expected in a 250 kg liquid-xenon WIMP dark matter detector was calculated and good agreement was found for the recoil event rates. The detailed model of neutron elastic scattering in GEANT4 was also shown to influence the nuclear recoil spectrum observed in the target, which is presently a shortcoming of FLUKA. We conclude that both packages are suited for this type of simulation, although further improvements are desirable in both cases.