Mary Erskine lived on a close off the High Street in Edinburgh, to the east of St Giles' Cathedral, and close to the Cowgate, then a fashionable suburb. She was born at Garlet House, Clackmannanshire, in 1629. Little is known of her early life, but in 1661 she married Robert Kennedie, a writer and they had five children, three boys and two girls, all of whom appear to have died in infancy. Robert Kennedie died in 1671 leaving Mary with considerable debts, although she managed to pay these off through careful management. On 23 September 1675, Mary Erskine married her second husband, James Hair, in North Leith. James Hair was a chemist, and owned a chemist's shop on the High Street. He was considerably younger than Mary Erskine, but he too died in 1683. By the contract of marriage, Mary Erskine inherited most of what belonged to her husband. It seems that this was not a large sum of money, but she used the money to set up a private bank, and built up a considerable fortune. She died on 2 June 1707 and was buried two days later in Greyfriars Kirkyard at the end of the section known as the Covenanters' Prison.
In 1694, Mary Erskine, by then known as Mrs Hair, donated 10,000 merks to the Merchant Company of Edinburgh for the maintenance of daughters of burgesses in the city of Edinburgh. The money was used to establish the Merchant Maiden Hospital, a girls' school, on the Cowgate. In 1706 Mrs Hair gave a further donation with which to buy a house and garden outside the city wall at Bristo. In 1707 she donated a further 4,000 merks to the Hospital, retaining the right to appoint two members of the Erskine family as governors. The Merchant Maiden Hospital was renamed and relocated several times, but in 1944 it was named The Mary Erskine School in honour of its founding benefactor. The school stood for many years at the west end of Queen Street but was demolished for redevelopment and is now located in the Ravelston area of Edinburgh. In 1704 Mary Erskine founded the Trades Maiden Hospital with the Incorporated Trades of Edinburgh, to provide boarding and education for the daughters and granddaughters of "decayed" craftsmen and tradesmen. This was at first situated in the Horse Wynd on the south side of what is now Chambers Street. In 1855 it moved to Rillbank at Sciennes. In 1892 it moved again, this time to Ashfield, 121 Grange Loan. Finally in 1971 it moved once more, to 61 Melville Street, on the corner with Manor Place, opposite the chapter house of St. Mary's Episcopal Cathedral.