Margaret I think we are related, but there are one or two discrepancies in details.
I have marriage record for Charles Devlin & Helen Hay June 29 1885. Charles' mother is Mary Devlin, prev McGuire, maiden surname Farmer. Suggesting she was a widow when she married Patrick.
Helen's parents were Robert Hay and Catherine Brannan.
I have death record for Patrick Devlin (Sept 30 1870) said to be 82 at time of death, but your . There may be some doubt about this age as there are discrepancies in census records. He is described as widower of Mary Farmer, prev Margaret Horn, prev Mary McIldoon. I think the 1825 marriage may have been to Mary McIldoon, not Farmer. Its unlikely that Mary Farmer b1809 could have been Mr McGuire's widow by the time of her marriage in 1825 age 16.
From various records available online at Scotland's People, I think Patrick came to Scotland before 1837 with daughter Briget (b c1826) and son Edward (b c1831, my GGGFather). His first wife Mary McIldoon probably died before the move.
By the time of 1841 census he has married Margaret (Pegy) Horn, possibly before move to Scotland. They had two children, Bernard (b c1839) and Mary (b c 1844).
Some time during the 1840s, Margaret dies and Patrick marries Mary Farmer who is widow of McGuire. They have two children Henry (b c1850) and Charles (b c1855 - your ancestor)
In the 1861 census, Charles is living with Patrick and Mary in Soap Work Lane Dundee. In the 1871 census, Charles is living with in Soap Work Lane with Edward's recent widow Ann and her 5 children.
I would be very interested in what you know of Patrick Devlin and Mary Farmer - how do know about dates and places of birth? Patrick's death record gives his father as Bryan Devlin (a farmer) and his mother Margaret Neil.