That sounds like something to try. How do I set an input as mouse x or y axis? And what file is that stored in?
Same as normal remaps: start game, tab, select either "input..." menu item, select what you want to remap with enter, spin/move spinner/mouse fast but not too fast, wait, (repeat enter - input input - enter as needed). The one thing in mame often gets both the X and Y axes.

You can either move off the item you're remapping, move back one and try again, or edit the file with a text file
after you've changed it from the default.
The files are in the cfg folder in the mame folder. If the changes are in "Input (general", it's the default.cfg file, otherwise it's the
gamename.cfg file. You can edit with any text editor (notepad works), or a good xml editor (an overkill IMO, though).