I don't know if it's sexual . It could be something else from deep inside . Maybe the errection comes from emotions like embarrassment or humiliation.
I say this because when I was about 8 , I was home from school sick, my Mom said I needed a enema. I was easily embarrassed , did not want anyone to see me without my clothes, even my Mom. So as usual I argued with her that I didn't want it, cried , begged . But to no avail , I lost the argument as usual. So there I was with a nozzle in my behind and zoom holding the bag whe opening and closing the clamp. When it was done I grabbed my underwear and pajama bottoms turned my back and started to dress as I was running for the bathroom. Mom laughed and said just go I will bring your clothes to the bathroom, I already saw you naked, just go.
But I got them on and mDe it to the bathroom. I locked the door and sat letting it come rushing out. I felt funny and looked down, good thing I loved the door. I had a errection, . Was scared to death, didn't know what happened,I looked at it in horror. I thought that's why I'm sick . I was to embarrassed to say anything to Mom. I sat there the enema finished coming out. In a few minutes it went down. I thought it was why I was sick, I thought there was something wrong. But it went back to normal. I had no idea about six, I thought a penis was just where you pee from. Well it didn't happen again for years. But in that time when ever I thought about it I was horrified.
So this had nothing to do with sex. But I was both embarrassed and humiliated at the time, so I'm thinking emotions