This is an example of vicarious conditioning.
Vicarious conditioning (VC) is a process of learning, whereby animals or humans acquire beliefs, attitudes and feelings towards a stimulus (in this case, the needle) based on observing others' responses and reactions towards it.In this instance, the children, through observing other children have "learned" to fear and get upset at the sight of a needle before it even touches them.