Obviously your daughter started sucking her thumb as a sign of insecurity with your second child. The problem is, once it becomes a habit it's VERY hard to stop. But you absolutely MUST stop this habit. The first step is to spend as much quality time as you possibly can with her. That's the most you can do to curb the insecurity. Don't make a big deal of it, and certainly don't punish her for it, it really doesn't help, only makes the insecurity worse.
My daughter (who is 8 1/2 now) has been sucking her thumb since birth and has basically deformed her mouth. She now has a palatal expander with a built in habit breaker in her mouth (which cost thousands of $$$). She would STILL suck her thumb in her sleep and ended up breaking off the habit breaker piece of her expander. Believe me, you want to stop the thumb sucking before it gets this far.
We tried everything, the nasty tasting nail polish (called Mavala Stop), bandaids on her thumbs, socks and gloves on her hands, an ace bandage around her elbow to keep her from bending her arm up to her mouth. None of it worked, but these would be the first things to try.
If your daughter is making the effort to stop sucking, you can try Thumbusters, which are fabric thumb covers that she wears all day. These only work as a reminder to stop sucking, so if she's not already trying to stop, they may not work. My daughter would suck the cover and all on her thumb, so they didn't work for her. They cost about $13 each on amazon.com. I haven't priced them anywhere else.
We are now using thumb guards (aka T-Guard) which are medical grade flexible plastic covers for her thumbs that use a bracelet, like the kind they use in hospitals, to secure them. They are not cheap, but if nothing else works, this is a last resort short of having a dental appliance installed in the mouth by an orthodontist. The cheapest place to find the thumb guard is on amazon.com, at about $45 each (they cost up to $80 each elsewhere). We had to get two of them since my daughter sucks both her thumbs. The total cost for both thumb guards with shipping was $99. Just look up "thumb guard for thumb sucking" on amazon and you will find they come in different sizes. There is one specifically for 5-6 year olds. My daughter has only been using them at bedtime (they're made to be used 24/7), since she has stopped sucking during the day, but already it's made a huge difference (it's been about a week). She can tell she hasn't sucked her thumb in her sleep and feels very proud in the morning. I wasn't thrilled about spending $100 on these things, but it's better than having to pay thousands more for another expander, and they seem to be working...finally!
Good luck breaking your daughter's habit. I hope this helps some.