Mary Eliza Mahoney was born in 1845 in Dorchester, Massachusetts. Mahoney's parents were freed slaves, originally from North Carolina, who moved north before the American Civil War in pursuit of a life with less racial discrimination. Mahoney was the elder of two children; with one sibling dying early on as a child. At a young age, Mahoney was a devout Baptist and churchgoer who frequently attended People's Baptist Church in Roxbury. Mahoney was admitted into the Phillips School at age 10, one of the first integrated schools in Boston, and stayed from first to fourth grade. Phillips School was known for teaching its students the value of morality and humanity, alongside general subjects such as English, History, Arithmetic, and more. It is said this instruction influenced Mahoney's early interest in nursing.