"My baby was born last year."
は is also correct. は emphasizes it as the topic of the sentence (i.e. "As for my baby, it was born last year" - maybe the previous sentence was about someone else's birth). が simply marks the preceding noun as the subject of the sentence (maybe the conversation was already about your baby, so you don't need to emphasize it as the topic).
To oversimplify things: If you can define it as n something from now (e.g. 1 year in the past, 2 days in the future…) you don't use に, if it's repetitive and further specified by context (e.g. Tuesday (last Tuesday? next Tuesday? the 7th Tuesday of 1970?), May (May 2020? May 2021? May 1984?), 2020 (2020 CE? 2020 BC? 2020 of some different calendar?)…) then you use に.
PS: Exceptions, exceptions, exceptions… PPS: Japanese tend to drop a lot of particles in casual speech.