Personally, I wouldn’t do it. The area of the bed around the tail light is going to be weak. You might reinforce it enough for maybe being OK on the road, but off road, the forces can be huge on the mounting areas. More so with larger tires. It might survive the trip and then fall off on the freeway on the way home. Imagine the surprise of the guy behind you!
It is at that point it becomes a real safety issue and one you maybe should not mess with. You want that spare 100% secure. You might be better off with a good bumper and a swing out mount on that, such as those Demello could likely provide. Way better then some makeshit approach if you ask me.