AFAIK the only thing that matter is whether it’s AT or MT, the 4th digit you’re referring to I’m sure is the updates between the pre 2012 and post 2012 engines which are the main two generations. I’d definitely recommend sticking to post 2012 because that’s after they fixed the Gallery Gasket failure. MT/AT difference is at the flywheel, so if you still have the old one you should be able to swap that in.
Note that while you’re in there you might wanna do the CSC delete/ CMAK if you haven’t already.
I definitely don’t know everything about these engine but I did just recently do an engine swap 2020 NISMO AT into my 2014 SPORT MT no problem.