“domesticated or tamed animal kept as a favorite,” 1530s, originally in Scottish and northern England dialect (and exclusively so until mid-18c.), a word of unknown origin. Sense of “indulged or favorite child” (c. 1500) is recorded slightly earlier than that of “animal kept as a favorite” (1530s), but the latter may be the primary meaning. Probably associated with or influenced by petty.
Source : Etymology online