I got a Marshadow in trade, but it didn't come with a z-crystal. How do I get one?
Currently, both Marshadow and its Z-Crystal are unobtainable, so to get it you'll have to hack it in or wait for a Marshadow event.
Source
Most likely you find one when you get your own Marshadow from the mystery gift.