"Imaginary Friend" was from the 5th season.
The episode begins with Counselor Troi talking Clara, a young daughter of a crewman, about the girl's imaginary friend she calls Isabella. The crewman is concerned about his daughter's behavior because the girl spends her social time with Isabella. Troi explains to the crewman that Isabella is with Clara wherever she goes, unlike real friends she leaves behind when her father gets transferred to other ships.
Meanwhile, the Enterprise is exploring a nebula that has formed around a neutron star. We see a ball of light working its way around the ship as the crew goes about their daily business.
Put these two scenarios together, what do you get? As Clara plants flowers, the ball of light finds her and probes the girl's mind and then---a flesh and blood Isabella appears. She leads the child to engineering while they're investigating a sudden turbulence of the ship. The Isabella entity wants to explore the entire ship.
Troi addresses the issue with Isabella in a pretend fashion in front of Clara. Clara relays to Troi that Isabella's response is "You better leave us alone."
This is the first major thing wrong with this episode. Why didn't Troi sense the presence of the intruder or sense that Clara was being sincere about Isabella being real and visible to her? Troi takes Clara for a walk and says that Isabella isn't invited. This does not sit well with the entity. The ship experiences more turbulence and loss of velocity.
The entity acts more malevolent, playing games on Troi and Alexander in the art room, and threatens Clara with death along with everyone else on the ship as the nebula continuously drains the ship of energy.
This episode seems lost in a lack of content, filling the void with Guinan talking to Clara and Troi about her imaginary friend when she was a child.
When the counselor confronts Clara about her bad behavior in her quarters, the Isabella entity reveals herself to Troi, knocking her unconscious.
Clara reveals to the captain in sick bay that Isabella's feelings were hurt when she wouldn't play with her. Again, why didn't Troi sense this?
Then the nebula begins to drain the shields of the Enterprise and the captain meets Clara and Isabella in the garden where Clara first met the entity. The Isabella entity tells the captain that her people in the nebula were trying to determine if the Enterprise was a threat to them and that the energy the ship possesses is something they need to consume. She tells that captain that the Enterprise crew should be destroyed because of the cruel way they've treated Clara. The entity took the perspective of a child. The captain explains that adults protect their children with rules and restrictions.
Clara asks the entity not to hurt them. Picard orders the ship away from the nebula but gives them a beam of energy to consume before leaving.
The child who played Clara was fine, but the child actress who played Isabella was wooden and gave me the creeps. This episode was mostly focused on the guest child actor and her exchanges with the other child and dealt with the childhood issues of imagination and loss of friendship. Heavy on human drama best suited for a children's book, but very light on science or excitement. It was a waste of time and should have been scrapped for something more appropriate for this series.