JJChang is right - it doesn't mean that you shouldn't have mentioned it, although you might feel that you shouldn't. Another way of saying it is "you pushed a button", but it's not as common as "touched a sore spot".
If I understand you correctly, you'd like to know some expressions for when someone's mentioned something that they shouldn't have? These are the only two I can think of right now but I'm sure there are more...
"You've opened up a can of worms" - There are going to be repurcussions now that you've mentioned that subject. (Also used for when someone's actions will cause repurcussions)
"You've let the cat out of the bag" - You've revealed a secret.
A slip of the tongue - When someone accidentally says something that they did not mean to say - A good example of this is when a mother accidentally calls one of her children by another of her children’s names.
A Freudian slip - Freud attached great significance to slips of the tongue, he believed that it revealed an unconscious emotion, belief, or desire – A good example of this is when you are arguing with your new boyfriend, and call him by your ex-husband’s name!!
To spill the beans - To reveal a secret, or to confess to something.
To tell tales out of school – To betray a confidence or to spread gossip. This originally was something said about children, but now it is used to mean anyone who reveals other people’s secrets. An example – If Jane tells Mary that her parents are getting a divorce, and then Mary tells her mother when she gets home from school...Mary is telling tales out of school, and Mary’s mother just learned a juicy piece of gossip!!
To stir up a hornets’ nest – A controversial, difficult, or unpleasant situation is referred to as a “hornets' nest.” If you make a comment that makes a lot of people angry, then you have stirred up a hornets' nest.
To put your foot in it or To put your foot in your mouth – To accidentally say something which embarrasses yourself, or upsets or embarrasses someone else – A very good example of this is when you ask a woman when her baby is due and she’s not pregnant!!
Skating/Walking on thin ice – To attempt to talk about a delicate or difficult subject without causing offense. It is better to skate on thin ice, and try to figure out if she is pregnant before you actually put your foot in it !! This is also said to someone who is risking causing offense or getting in trouble – a mother might say “You are skating on thin ice” to a rambunctious child.
Let sleeping dogs lie – Said to warn someone not to bring up a bad subject that people have either forgotten about, or want to forget about – Please do not disturb the dogs, they will start barking!!