I use rockauto.com extensively, as they seem to have all the parts and numbers to go with them. If it were a GM product, I'd use gmpartsdirect.com as they have a great database as well. I don't know if there is anything like that for Mazda parts (or Ford parts for the crossover of that). I'll see if I can find something when I get home this evening.
While looking on that site, if you look for Motocraft parts (for you Mazda), it should have the original part numbers for you. Also, on RockAuto, there will often be a "info" button just to the right of the part number. When you click that, there will usually be an OEM part number listed in there if they have one. I've seen it on about 75% of the products they stock. The OEM number may not be on ever part within a category, but it will usually be on one of them.