Imitation is the sincerest of flattery.
Charles Caleb "C. C." Colton (1780-1832) English cleric, writer, aphorist
Lacon: Or, Many Things in Few Words, Vol. 1, § 217 (1820)
(Source)
This reference predates by several decades the (attributed) Oscar Wilde, "Imitation is the sincerest form of flattery that mediocrity can pay to greatness" (1880s) though a variety of thematically similar quotations came about in the interim. By the 1850s "form" had been soundly fit into the common phrase.
More discussion here: Quote Origin: Imitation Is the Sincerest Form of Flattery That Mediocrity Can Pay To Greatness – Quote Investigator®.
Pingback: (Attributed) - Allen, Fred | WIST Quotations