SRAM x5 derailleur fitting
I assume you are using the derailleur bolt from the original with the new derailleur. Derailleur bolts are standard M10 x 1.0mm pitch, so that should be fine. The derailleur should rotate around that bolt, as long as it's not loose and does not have any play it's OK.

Without a chain installed the range of rotation will be quite wide, especially if the b-screw is wound out. After installing the chain, just adjust the derailleur properly and you should be OK.



Update:

Make sure the B-screw adjustment washer is in place. If it isn't the derailleur would move laterally on the bushing the bolt goes through.

 



BTW if you are a novice, there is plenty of bike wrenching instruction on the web. the Park Tool site and YouTube channel is a great resource.