Dear Alex: being ignorant of both, I looked in my dictionary, and briefly, syntax is a subset of grammar:

Grammar: that part of the study of language which deals with the forms and structure of words (morphology), with their customary arrangement in phrases and sentences (syntax), and now often with language sounds (phonology) and word meanings (semantics)