I have a girl, now almost 7 years old... and I went through that too.
Try getting the book "Your 5 Year Old" or, "Your 6 Year Old" from www.amazon.com
It is enlightening and about what a child is like at each age juncture.
Girls, alas, are more emotional... my girl goes through that "attention, look at me" thing too... but I have learned, it happens mostly when she is undergoing a change in age set, or developmental changes. Their emotional AND intellectual development changes too... and even a typically confident child, can get "needy" and/or needing more attention/confirmation of themselves.
Its normal. Though not easy.
It is not humanely possible to spend EVERY SINGLE minute giving them quality time. And, even if you do... that does not mean it will "cure" the moment either.
We mostly, give our girl "coping skills" per her moods or needs... if she is frustrated/fussy/needy... we direct her/navigate her to "What else can you do? Hey, how about doing your craft kit???" Then we get her "distracted" with something else. AND, we also talk WITH her directly, telling her we love her, that we all need attention even adults, that some days are harder than others... but we are all a TEAM... and we help each other. Then engage her in other things... either jointly or an independent activity, BUT in the SAME room as us. So she feels "included."
We also teach her that everyone in a family has a "job"... Mommy has her chores, and Daddy too... and her "job" is to do hers... like "practicing" her activities by herself or allowing Mommy a moment to cook dinner because we all contribute to things for the family... then I put things on the dinner table while I cook, so she can entertain herself by herself.... while I cook, for example. That is her "job."
Just get creative.
Also teach her about feeling good about herself and not "needing" others to validate her. My girl at least, is good about that. She always says "I'm myself..." and she knows what is 'good' or 'bad' and can read people & will steer away from adults/kids that have a bad vibe about them.... thus, she has good instincts about "danger." It has to be taught as well... so that they, as a child, can learn "discernment" versus just needing "attention" for feeling good. Teach your girl perhaps, about healthy 'reasons' for needing attention, versus just out of boredom, for example. AND, teach her about her feelings.... so she can gradually learn about herself and others...
She may be young to understand it completely... but just exposure to "ideas" about it, will over time, give them knowledge and a good foundation about it.
My girl for example will say things like "Mary always likes attention at school, but she does it because she likes to be #1 all the time. If other kids get attention, she gets irritated & sassy..." And, she is right about this kid. Even her Teacher has to manage this child as such. So.. .it is also about countering their need for attention, with teaching them skills about how to manage situations.... and know themselves.
Its a phase. It will pass. BUT, going from 5 years old to 6 years old... is a big jump, emotionally/intellectually/cognitively. I witnessed that myself in my girl... and her classmates of the same age. MANY Moms told me the SAME thing about their daughters. :)
So don't feel alone in it.
My girl now, at almost 7 years old... is going through it now, again.... but with a different twist to it... she "compares" more in terms of attention between herself and her brother (whom she loves dearly), but their "self-esteem" is "changing" too at this age... in relation to the world and where they fit in it.... so its a complex mix. We just giver her understanding... its not easy and is growing-pains, as well, for the child.
Mostly, do NOT punish/scold her for anything that she can't help or control herself with yet... they are not perfect or adept and sometimes do not even know why they feel that way. All a part of childhood. Its okay. But tries our patience. But we need to be there for them.
Heck, even women on PMS get "moody" and needy, right? Well, same for a little girl. Their "hormones" is changing too.
**And YES... she is old enough to be taught about "stranger danger" and HER behavior. In this day and age, it is very important. We have done that with my daughter from an even younger age. We even taught her about how to sit with her legs crossed, so that her panties are not visible to strangers looking, for example. You NEED to teach kids this. Even your Husband, should, along with you, talk with your girl about it. We also taught our girl about self-defense and what to do in situations. We act-it out with her, and do pretend scenarios with her. They need to "practice."
Oh, also, perhaps she needs an 'outlet.' Maybe she'd enjoy Theater classes for kids? The performing arts is real great for kids, and may satisfy her need for "attention" or always acting up/goofing around in front of others.????
All the best,
Susan