Motor Selection for Encoder

I have a motor that is working in conjunction with encoder 516-2399-ND and the motor needs to be replaced. I don’t have a lot of information on the motor other than it is 24VDC. I think 966-1756-ND should do the trick but is there something more that needs to be considered than just the shaft size? Can someone please confirm that this motor would work with the encoder?

Thank you.