I know this is an old thread but I figured I'd respond to OP in the event someone else is looking for that info.
the 03-05 6i has a 4 speed auto, the FN4A-EL (Ford calls it the 4f27e).
the 06-13 6i has a 5 speed auto, the FS5A-EL (Ford calls it the FNR5). Its an updated version of the FN4 with an extra gear added.
OPs replacement Trans is a FS5, as indicated by the extra speed sensor and it having the secondary valve body. In addition, the transmissions are not electronically compatible (solenoids are arranged differently...plus the extra gear) but the current trans is a FN4.
while a few models might have the same trans, they can often differ in gearing/final drive and bellhousing. I put an FS5 from a 2010 mazda 3 in my 07 6i in July and had to swap the bellhousing over (the 3 bellhousing lacked a provision for the dogbone mount) and contend with a slightly different final drive ratio.
if final drive is no consequence and you are pretty handy, you can find a FN4 from a Mazda 3 for cheaper and often with lower miles than a mazda 6.
likewise, you can find a gen2 Mazda 6 FS5 with lower miles for much cheaper than a gen1 FS5 (not sure on the bellhousing or final drive differences between gen1 and gen2 though).
4f27e can be found in:
??-08 Mazda 3 2.0l
03-05 Mazda 6i
00-11 Ford Focus (end cover and some coolant lines are for sure different)
FNR5 can be found in:
??-08 Mazda 3s (2.3l)
09-13 Mazda 3i & 3s (non skyactiv)
06-13 Mazda 6i
06-09 Ford Fusion/Mercury Milan 2.3
??-?? Mazda CX-7 (non-turbo)
EDIT: swapped the 3 trans to a 2012 Mazda 6 trans (long story). It seems Mazda replaced the Transmission fill tube after 2011 with a plug, so I swapped over my original. I have done about 20k on the trans with no issues. running Valvoline Import ATF as its within spec of the Mazda V.