If you add the following to magic4lazarus.pas, i seems to be fine on Mac OS X, too:
{$IFDEF DARWIN}
MAGIC_LIBRARY = 'libmagic.dylib';
{$linklib libmagic}
{$ENDIF}
After moving magic.mgc into this directory in the application bundle (filemimetest.app/Contents/MacOS) the example worked. fpc 2.4.0, lazarus 0.9.28.2
I don't expect it matters, but libmagic was installed as file (5.03) using fink.