Immediately take it to a good Mazda shop (not dealer, few are willing to do it) and have them suck out the transfer case fluid. I would not drive the car unless it had fresh fluids.
Our 2010 CX9 Sport AWD got its transfer case and transmission replaced at 65K. Luckily all under the powertrain...