Your timing is a little weird - I'm trying to fix the same issue on an 07 Mazda 6.
I think the engines are are same (2.3). Where the shift cable connects to the trans - there is a large nut and washer. (Beneath the air box, down low). Mine is really rusted. As I understand it, the rust prevents the gear selector from operating to the park position.
As a temporary fix, you can hit it with PB blaster. It fixed mine for about a month. Maybe start there first. The neutral interlock switch sits right behind the bracket - about a $100 bucks. But I would see if you can free the nut first before replacing the switch.
I'm looking for a replacement nut and washer now - just haven't been able to get the nut loose and make it to the hardware store. (I'm too cheap to pay the dealer $8 for a nut and washer).
There is a TSB on this for the Mazda 3 somewhere that shows how to do it. (Basically you hold the bracket with a crescent wrench to keep from damaging the switch, while loosening).
Hope it helps.