Fetal programming is a process initiated by intrauterine conditions, leaving a lasting impact on the offspring's health, whether they manifest immediately or later in life. It is believed that children born to mothers with gestational diabetes mellitus (GDM) and excessive gestational weight gain (EGWG) may be at an increased risk of developing type 2 diabetes mellitus (T2DM) and obesity later in their adult lives. Substance P is a neurotransmitter associated with obesity development and impairment of insulin signaling. Dysregulation of substance P could lead to several pregnancy pathologies, such as preeclampsia and preterm birth. Our study aimed to compare substance P concentrations in serum and umbilical cord blood in patients with GDM, EGWG, and healthy women with a family history of gestational weight gain. Substance P levels in umbilical cord blood were significantly higher in the GDM group compared to the EGWG and control groups. Substance P levels in serum and umbilical cord blood were positively correlated in all groups and the GDM group. A very interesting direction for future research is the relationship between the concentration of substance P in newborns of diabetic mothers and the occurrence of respiratory distress syndrome as a complication of impaired surfactant synthesis. To our knowledge, it is the first study assessing substance P concentration in GDM and EGWG patients.