I've tried Scotlands People, Lancashire BMDs on 'soundex' and 'vague' options, and free BMDs looking for any McWilliam to any Margaret - nearest I could find were:
Halifax June 1883, Alexander McWilliam to Margaret Smith
Lanchester (in desperation for a soundalike!) Dec 1882, Margaret Andrews to either John Palmer of Wiiliam Cowton

Sorry, couldn't find anything else.
Is is possible that Mary McWilliams is actually the child of Margaret Andrews and an earlier husband, so Alexander is her stepfather?

Barbara