Mask a sticker image so that it fits onto a main image without parts of the sticker that are outside the image being visible – How?

Main image (car) and sticker – everything under the blue line should not be visible(https://i.stack.imgur.com/NcN0W.png)

I want to create a website where you have a main image and stickers that you can stick on the main image. The stickers should behave like real stickers, so when you stick them on an edge, only the part of the sticker that is on the front is visible, not the bottom. For example, everything below the blue line in the example image must be cut off the sticker. The stickers should be able to be moved at any time, so the code to mask the stickers should be written relatively dynamically or generally and not specifically for a certain place on the car, for example. I searched a lot but couldnt find anything which was satisfying, does anybody know how you could do that?

I already tried different things with CSS mask-image, but when I tried to use for example mask-composite it didn’t do anything – I dont know if I just implemented it wrong.