This may not be it at all, but here goes. This drew my attention:
- Either when gas pedal is pushed or released
Could it be the seat? Your body will shift as the car accelerates and decelerates, particularly at lower speeds. I had a problem with the seat in my M550ix, though the sound differed (more of a pop), and the M550 has different seats from the M5.
Thread here:
https://g30.bimmerpost.com/forums/sh....php?t=1560595
To see if it is the seat, try sitting in the car, while stopped, and engine off. Then put your foot on the footwell and push back into the seat as if you are accelerating. See if that pushes your butt down and makes the noise.