Lung infection occurring in the first few days of life due to uterine exposure to infectious microorganisms or to infection during or immediately after birth. Common causes include viruses (e.g., herpes simplex) and bacteria (e.g., group B streptococcus, Chlamydia, Escherichia coli, Listeria).