Thanks for your answer Floob.
I am using Retropie 2.6 and there I put all the games in the neogeo-gngeopi roms folder. My gngeorc looks like this `p1control A=K122,A=J0B13,B=K120,B=J0B14,C=K97,C=J0B15,D=K115,D=J0B12,START=K49,START=J0B3,COIN=K51,COIN=J0B11,UP=K273,UP=J0B4,DOWN=K274,DOWN=J0B6,LEFT=K276,LEFT=J0B7,RIGHT=K275,RIGHT=J0B5,MENU=K27,MENU=J0B05829,MENU=K27,MENU=J0B0
p2control A=K122,A=J1B13,B=K120,B=J1B14,C=K97,C=J1B15,D=K115,D=J1B12,START=K49,START=J1B3,COIN=K51,COIN=J1B11,UP=K273,UP=J1B4,DOWN=K274,DOWN=J1B6,LEFT=K276,LEFT=J1B7,RIGHT=K275,RIGHT=J1B5,MENU=K27,MENU=J1B0
country usa
system unibios
rompath /home/pi/RetroPie/roms/neogeo-gngeopi
`
I use wireless ps3 controllers. The neogeo.zip contains all the files and unibios 3.1. There are only several games like MS5 or Spin Master which have these problems.