I very much agree with Pete's comment that we will find incipient instances of the universal mapping property among many classical constructions in mathematics, even if the original users of those concepts would not describe the idea in those terms. Indeed, I believe that these instances will stretch back through the whole of mathematics, and for this reason, there may be no definitive answer to the question.
But let me anyway introduce a very early classical construction that we might agree has the hallmarks of a universal mapping property. To my mind, one of the fundamental essences of the UMP definitions is that they specify an object $U$ that relates to given objects $A,B,\ldots$ in a certain way, such that any other object $V$ relating to $A,B,\ldots$ in that same way then stands in a certain relation to $U$. This is the sense in which $U$ is universal with that property, and the particular details of the relations determine the nature of the universal property.
My proposal is to consider the ancient idea of commensurability of line segments, appearing in Euclid's Elements and used earlier. Commensurability is of course intimately connected with the concept of greatest common divisor arising in the Euclidean algorithm, appearing in Books VII and X of Euclid's Elements.
Specifically, two line segments $K$ and $L$ are comensurable when there is another line segment $R$ such that $K$ and $L$ are common multiples of $R$. The ancients knew not only that there was a largest such common measure $R$, but also that this largest common measure has a universal property: if $S$ is any other common measure of $K$ and $L$, then $R$ is a multiple of $S$. Thus, the largest common measure of commensurable line segments is characterized by a universal property, known in antiquity.
This fact is of course related to the fact, also known to the ancients, that the greatest common divisor $d$ of two natural numbers $a$ and $b$ is not only the greatest common divisor of $a$ and $b$, but has the universal property that any other common divisor of $a$ and $b$ is a divisor of $d$. Thus, the gcd of two integers is characterized by a universal property, also known in antiquity.