Peru is moving toward a universal health insurance system, and it is facing important challenges in the provision of public health services. As more citizens gain access to health insurance, the flow of patients exceeds the capacity of public hospitals to provide care with quality. In this study we explore the relationship between technical efficiency and patient safety events in neonatal care units of Peru's public hospitals. We use Data Envelope Analysis (DEA) with output congestion to assess the association between technical efficiency and patient safety events. We study 35 neonatal care units of public hospitals in Peru's Social Security Health System, and identify two undesirable (risk-adjusted) safety outcomes: neonatal mortality and near-miss neonatal mortality. We found that for about half of hospital's neonatal care units, technical efficiency is affected by output congestion. For those hospitals, patient safety is being compromised by receiving too many patients. Our results are consistent with public reports indicating that hospitals in the Peru's Social Security Health System are overcrowded, affecting efficiency and jeopardizing quality of care. We found that most congested hospitals are located in the capital city and suburban areas, and are more likely to be hospitals with the lowest and the highest level of care. Our results call for improvements in the patient referral system and capacity expansion.