I wanted to add that since she is school age and if you live in the US, she could have a mental health evaluation for free through the school system. A developmental evaluation would be good also as her mother was a drug user. Good luck.
I am guessing that she was abused in the past. I would definately have a full mental health evaluation and as the above poster said, counseling would be wonderful for her. She has had it tough in her short life. I wish you and her all the best.
I think it would be good to have some counselling for this little girl what does her school say regarding these extreme behaviors you say she behaves like this at school aswell,she seems to be very upset and emotional about something so some help is definatly required.