My daughter did the same thing about the same time- at least with tone of voice. First thing, I made sure to keep my tone under control and avoid being sarcastic. She often sounded like me but with her own variation on the attitude. I found I had been on her case lately and stressed around her. I talked to her and explained that Mommy hadn't been choosing kind words to her and others. I apologized and explained that we would both be working on our kindness together.(My husband and I were separated at the time, and I was feeling stressed financially.)
So occasionally she busted me for not being kind or being cranky. I fessed up and corrected my behavior when she was right. (Ugh. Having kids sure makes you more aware of yourself... little mirrors and tape recorders...)
She was hugely into dress up back then. I warned her that princesses don't act ugly. If she did act ugly, then she would lose a princess dress forever. I only had to take one because it impacted her.
I occasionally sent her to time out or her room until she could choose kinder words and control her attitude.
Sometimes the situation made it clear that she didn't realize she said something rude. For instance if she commented on someone's appearance at a store, we would talk about why you shouldn't say something like that. The person could overhear and get their feelings hurt. They might not understand that you meant to ask a question... She is pretty empathetic so the idea of someone having hurt feelings made her want to be more careful.
Certain Barbie movies, Gigi, and kids films and stories allowed me to compliment and make a big fuss out of kids acting politely. This really helped her see examples of what is good behavior... plus my cleaned up example. Cartoon Network and several "kids" shows model terrible attitudes. Heck, even commercials can model some rude attitudes.
I remember practicing what is OK to say and how you can say it. This helped her learn more appropriate responses. It was more work than just correcting her, but I let her know I expected her to make kinder choices with her words and reactions.
She is 6 now and has been whining lately. We've gone back a bit, but she is still expected to choose good reactions. She knows a hissy fit or hitting someone is not acceptable. She knows she is allowed too feel angry if she doesn't get her way, but that doesn't give her permission to act badly. Haven't had to take anything away lately. I'm able to take her to work, but didn't take her that day... It's also been easier this time because she sees how Mommy talks to Daddy and how I react when I don't get my way. (I've learned over the years, too.)
Personally, I would save the Tobasco or soap for actual filth words. But make sure kid understands it's a bad word. I remember getting popped as a kid for repeating words that my Abuelita (Grandma) said because I didn't know those were bad Spanish words.