"The most obvious form of flattery is imitation."
My oldest son used to do this many yrs. ago. He is a yr. younger than the neighbor boy. He is also very, very shy. When my son was 5 and "Bobby" was 6, they would play together. My son would often imitate Bobby's jokes, what he said, how he laughed, what he wanted for lunch. It may not have been everything, but it was close. It was annoying to Bobby, his parents, and me. My son was happy acting like and sounding like Bobby. He thought Bobby was the coolest. I talked to the pediatrician about it. We had recently moved across the country, my husband started traveling a lot, Bobby was his closest friend and his idol.
He felt secure and like he "belonged" when he imitated Bobby. It was a long, careful process, but thru some talking and role play, we got it to stop. Be patient. This girl looks up to your daughter a lot and hasn't found her sense of "self" yet.