Objective: We compared neonatal immunity after vaccination against SARS-CoV-2 during pregnancy to that achieved after maternal infection. Study design: We tested cord blood from women infected with SARS-CoV-2 during pregnancy (group 1, n = 29), women who were vaccinated during pregnancy (group 2, n = 29) and from women not infected and not vaccinated (Group 3, n = 21) for titers of antibodies to both SARS-CoV-2 spike and ‘N’ proteins. Results: Seventy-nine women were included: Antibodies against SARS-CoV-2 spike protein were detected in all samples from Group 1 and 2. Antibodies to the ‘N’ protein were detected in 25/29 samples in Group 1. None of the samples from Group 3 had antibodies to either protein. Mean titers of SARS-CoV-2 antibodies were significantly higher in Group 2 than in Group 1 (p < 0.05). Conclusions: Neonates born to mothers vaccinated during pregnancy have higher antibody titers and may therefore have more prolonged protection than those born to women infected during pregnancy.