"A cat, typically one that does not have a pedigree or is otherwise unremarkable", Late 17th century: variant of Maggie, pet form of the given name Margaret.
More
This informal word for a cat is a variant of Maggie, a pet form of the name Margaret.[moggie etymology, moggie origin, 英语词源]