The correct name in Gaelic is Coillte Maghach (or Coillte Mach) - The Woods of Maghach.
Maghach was a chieftain of the Fir Bolg, the earliest Celtic people to colonise Bronze Age Ireland. The Celts were an Iron Age race and Irish mythology tells of three Celtic invasions - effectively replacing a Bronze Age culture with that of the superior Iron Age.
The Fir Bolg were defeated by the Tuatha e Danaan (the second wave of Iron Age Celts) at the Battle of Moytura, southwest of present Kiltimagh. Maghach, one of the defeated chieftains sought refuge on Sliabh Cairn mountain which was then wooded, i.e. Coillte Maghach. Subsequently, after his death he was buried on the mountain, and the area came to be called after him.
This legend is typical of invasion myths. The story locates the burials of a celtic chieftain in an area that would have been ritually important to the previous culture - i.e. a Bronze Age cemetery. In this way, the ancient sacred site was subsumed into the new and dominant culture.