These studies look at the protective effect of breastfeeding on newborn pain.
The impact of breastmilk smell on newborn pain
This study evaluated the effect of the smells of amniotic fluid, breast milk, and lavender on the pain of newborns during heel lance. It was found that the smells of lavender and breast milk helped prevent heart rates from rising and oxygen saturation rates from falling, and reduced the Neonatal Infant Pain Scale score during the invasive procedures in newborns more than amniotic fluid or the control group.
Related research and further reading
The Lancet: Increasing breastfeeding worldwide could prevent over 800,000 child deaths every year