Self-insertion

Sandro Botticelli's painting of the Adoration of the Magi has an inserted self-portrait to the far right: the position in the corner and looking out at the viewer are very classical of such self-portraits.

Self-insertion is a literary phenomenon in which a fictional character, that represents the true author of a work of fiction, appears as a version of themselves as a character within that fiction, openly or hiddenly.

In art, it's similar to a self-portrait, where the artist includes himself in a painting of a narrative subject. This has been a common artifice since at least the Renaissance.