There can't be a one size fits all answer. It depends much on the kind of site, it's goals, and even more so on exact circumstances of each comment/action.
comments like "It would be so great if moderators were experts in the topic of the site!"
Looks like a good example where context is everything as it depends quite on what happened before. If there was a comment by a moderator regarding any topical item, or more important any moderation decision based on topical content, then this may be a valid critique. Being a moderator automatically comes with the bonus assumption of being an expert. Showing otherwise will draw more blunt response than any other commenter would get. This may sound unfair, but it comes natural.
Fighting such comments may easy create a downward spiral for the site or at least create an unease feeling among all participants.
Now, if it was clearly unprovoked in the actual context (needs to be checked quite carefully), then a clear warning about staying on topic needs to be given.
or "That other community is so much nicer than this one!"
Again, this needs a check if there is a previous context he may refer to, supporting his point. If not (check carefully), it's again a case to give a clear message.
When moderators contact the user, the user replies with gibes or sarcastically.
That's an irky area. Private communication should usually not be of any consideration for public action. It will of course help to build your opinion about the offending user. He should as well (using the same medium) given a clear, non offensive, but firm reply, pointing out all short comings in simple language.
But unless he issues explicit threads, all public action should be only based on public available knowledge. Acting in public is as much about the impression other members will get as it is about resolving the case.
How should moderators deal with such a behavior effectively?
By carefully looking at each instance and react as close to the exact circumstances. Using global and or meta argumentation will always leave room for further unease. Maybe not so much with the offender, than with other users unaware of the circumstances decisions are based on.
Moderation privilege does not make one immune from overreacting or bad behaviour, so always check circumstances and act according when herding the flock.