My son was doing this too - and I would also describe mine as stubborn and difficult. He was completely trained shortly after his third birthday and then a year later we moved to a new area, and as a result lost our beloved nanny. The twins had just turned four, so we put the kids into Pre-K. About a month later the accidents started. He would refuse to use the bathroom when I asked him, then go "hide" somewhere, poop in his pants and then tell me. It happened over and over again, every day, for months. (Also, like yours, he would refuse to dress himself or brush his teeth, and sometimes even feed himself, all the "big boy" skills he had taken pride in before.)
I tried talking to him, yelling, buying special underwear and making a big deal out of throwing out the soiled ones. None of this worked. What finally worked was when I instituted a star chart reward system for both of my kids. I included making the bed, dressing themselves, brushing their teeth and pooping on the potty as the four things they need to do every day. The reward for having 20 stars is to select a (cheap) toy at the end of each week (usually the drugstore or the dollar store.) The first week he had not one single accident, he was so excited about getting the stars. We have been on the star chart system now for about six months. I will be honest that he has had setbacks a couple of times, and when it happens, it will happen for a few days in a row. But then I remind him that he doesn't get his star, that he might not have enough to get his toy on Saturday, and then he gets control of it again. At this point it has been two months at least since the last accident.
In the case of my son, I attribute the regression in behavior to the changes in his environment - the new house, new school, loss of our nanny (she was like a grandmother to the kids and they adored her.) He didn't have a handle on his feelings to be able to express them, other than by acting out. What finally worked was figuring out the right incentive that motivated him.
Good luck to you - I know this is a frustrating problem.