Hi Hannu,
you mean you tried to map dosbox's virtual joystick buttons to your real, material gamepad? Or otherwise?
I didn't do this before, cause we always wanted to use only keyboards, but few minutes ago I took my gamepad and tried to enable it in dosbox just for Nhl 95.
It worked! Skating as well as shooting/passing.
What I did:
1. I'm using D-fend Reloaded frontend
2. I set "Joystick type" in "Joystick" menu to AUTO (in d-fend you'll find this menu clicking rmb on nhl95 profile and selecting "edit")
3. I started nhl95, then pressed ctrl+f1 to open the internal mapper
4. In mapper: under the qwerty keyboard and above the "shutdown-capmouse-fullscreen" keys you see two virtual joysticks. Only the left one is of our concern.
5. Y-/Y+/X-/X+ should be related to a directional pad of your gamepad - but you wrote this worked for you.
6. Buttons. Most important: you should click button "1" and delete its default binding! Next, do the same with button "2". If you leave the default bindings and add your desired ones, it's possible that conflicts will occur and buttons won't work.
7. After having removed default bindigs I remapped virtual joystick buttons to my gamepad buttons. Button "1" is for pass, button "2" is for shot.
I played one period with my gamepad - no problems, besides I'm so accustomed to play with keyboard I wasn't able to construct one decent offensive action
The procedure is actually the same if you're remapping virtual joystick to keyboard.
I'm afraid I've written this pseudo-tutorial in some chaotic manner, but I hope it'll help nevertheless.
But if it won't help - don't hesitate to ask.
cheers
ps: I used a generic low-end low-priced gamepad.