@krupper is your controller maped as a joystick (-> axis) or as dpad (-> buttons)?
If your joystick is maped to axis than you might want to add these lines to the input config of mame:
This maps the joystick axis of the (left) joystick to the dpad of player 1..
If you have 2 joysticks and want to map each one for a seperate player use the value 2 for player 2... if you only have 2 players remove player3 and player4
Play around with that (if your joysticks are mapped as joysticks!)