I searched the Irish Family History Foundation's database. It contains 12,000,000 surviving rcds for abt 65% or Irish counties. Rcds B4 1840 are sparse.
For Margaret Fagan B 1849 (exact) in Co. Meath and with a father named Patrick, I found 1 B rcd in Donore parish. The rcd is likely for your ancestor.
Note - Rcd keeping didn't start in Donore until 1840. All but 4 parishes were keeping rcds after 1840.
For a Marriage of Patrick and Mary, I suspect it would have been in 1848. There is an M rcd in Meath for Mary Matthews for this yr in Curraha parish. However, there is no correlated rcd for Patrick. But, I have found 3 instances where IFHF rcd'd one party to a marriage, but not the other. You might want to take a chance on this isolated rcd. If it shows Patrick Fagan as the groom, the rcd is validated.
For Mary Matthews B 1825 +/- 4 yrs, I found 16 B rcds. One of these, is in Curraha parish, in 1823.
For Patrick Fagan B 1822 +/- 4 yrs, I found 10 B rcds.
For Michael Fagan B 1822 +/- 4 yrs, I found 14 B rcds.
For Nicholas Fagan, I found only 1 B rcd which fits your time line. This is in 1840. This would have made him 16 when he emigrated. The parish is Kilskyre.
Google the Foundation's name to lead you to this database. Pls post your search results to my genforum msg. Good luck.