basically, 626 or 929 is right, since they were the same.
http://www.ausrotary.com/viewtopic.php?t=2735
3. Smooth Case. These were Mazda’s mainstay from the late 1970s into the mid eighties, and so were fitted to RWD 323s, RWD 626s, 929Ls, HB (“Cosmo”) 929s, 1st Generation RX-7s, 12A Turbos, non-turbo Series 4 RX-7s, and many vans and utes.
They can be identified obviously by their smooth case, and by their integral bell-housing. Some later cars (most commonly FE powered 929s) have a circumferential external rib around the bell-housing.
*323 boxes have a smaller diameter input shaft compared to others, which all have the common 22-spline input shaft. This version is distinctive due to its smaller bell-housing which has a raised section with a flat top, where it bolts to the motor. These are available in both 4 and 5-speed versions. Notably the cases are different (due to the extra length required for the 5th gear), making the 5-speed a difficult fit into a factory fitted 4-speed 323. 808s have more mounting points, and so are a much easier fit. For both cars, factory auto version will easily accommodate the 5-speed gearbox.
*The S1 RX-7 gearbox is a direct swap for the earlier RX-4 / RX-5 gearbox, and all mounting points, shifter position etc are the same. The rotary gearboxes can be identified by having a hole for the starter motor to be fitted to (piston motors have the starter motor fitted to the engine). All smooth case rotary gearboxes are 5-speed.
*S2, S3, S4 RX-7s have a remote shifter that places the shift lever 100mm further back compared to the S1 RX-7 gearbox. These are a substantial update over the S1 boxes and are much stronger, although not indestructible.
* The RWD 626 boxes and the later MA-powered 929 boxes are identical to each other. These have the best ratios of any Mazda production gearbox. They can be identified by the very short distance from the motor to the gear lever – it is 100mm shorter than the S1 RX-7 gearbox, making it 200mm shorter than the S2 and later RX-7 boxes. Available in both 4 and 5-speed versions.
*The FE Smooth Case gearbox, as fitted to post 1983 929s is identified by its larger bell-housing with a raised flat top section where it bolts to the motor. Apparently these gearboxes received the same improvements as the S2 and later RX-7 gearboxes. 5-speed only
*The van boxes are column shift, and generally have appalling ratios for road car use. They have bell-housings the same as the car boxes (ie, to suit TC,UC, D5, NA, VC, MA, and FE motors).
*The S3 and S4 NA boxes also have a unique output shaft size, which is larger than the earlier gearobxes.
The front case/bell-housings are interchangeable between all gearboxes. It is possible to put a RX-7 front case onto a 626 gearbox to make it fit a rotary motor, or a FE case onto an RX-7 gearbox if a replacement FE gearbox was not available. The 323 gearbox is the exception to this, as it incredibly has a slightly different shape, so none of the bolts line up if you attempt to bolt a 323 bell-housing onto a gearbox from a larger car. It would also require a custom clutch plate (due to its smaller input shaft, and smaller diameter shaft). The 323 also appears to have a smaller bearing in the front case.
The extension housings are also interchangeable, meaning that on any gearbox, you have the choice of four different shifter positions (626, S1, S2 or S4 NA).
The Smooth case gearboxes are generally weak. The S1 RX-7 box in particular has a (well deserved) reputation for breaking with very little provocation. Breaking input shafts, output shafts, stripping teeth off gears, breaking cases and jamming in gear are all common. The piston gearboxes are no stronger, but are generally OK as they rarely have to withstand as much power as the rotary gearboxes. Interestingly, the ‘works’ racing gearboxes have much thicker cases, suggesting that much of the strength issue is due to a weak, flexible casing.
****Update. The 5-speed MX-5 gearboxes are smooth-case type gearboxes. Ratios are similar to both S1 and S2 RX-7, without being the same as either . They also have the big power-train girdle, like a S6 RX-7, and are therefore difficult to mount into earlier cars.
The 6-speed MX-5 gearboxes are an Aisin manufactured gearbox, which is the same gearbox as fitted to the Lexus IS200, S15 200SX, and the new RX-8. I do not yet have any info on ratios, mountings or input/output shafts.