The Maskelyne name is on my family tree due to Nevil Maskelyne's grandson marrying the niece of my 3x great grandfather. Their daughter wrote a book about their home Basset Down House, with some history of the family. Anyway, I thought I'd take a look.
There are a few Williams in the family, but this one does indeed come from Marlborough, born in 1839 son of John and Elizabeth (nee Cruse) William was a printer at marriage and his father an clerk and accountant who died in 1850. The family are in the 1841 census with an indicated dob for John on 1811 (ie age 30). Various baptism records indicate that the family were previously in Preshute.
After this the trail gets a little harder and more speculative but there is a John Maslin baptised in Preshute in 1805 son of Robert and Frances. This may be the same person, with the family going "oh lets posh up our name a bit" or it may be a "typo" or phonetic spelling etc etc.
Ancestry has a tendency to "suggest" other records that may relate to the same person. Sometimes this proves to be spot on and others, not so much. In this instance, it is suggesting that Robert was originally a Maskelyne, son of William and Mary. Further suggestions take this to be William who died in 1772, whose will is on Ancestry and that he was at Cambridge. If this is all true, this William was the brother of Nevil, the Astronomer.
Bottom line, he may or may not be related, but please someone feel free to take up the trail and check some of this speculation!