A court heard Shaun Townend leaned out of his Vauxhall Astra and fired the BB gun at the victim’s vehicle during the disturbance.
Townend was locked up for two years over the incident which took place in the Fryston area of Castleford on March 20 this year.
Michael Smith, prosecuting, said the victim saw Townend behind the wheel of the Astra as she was driving to pick her child up from school.
Mr Smith said the woman knew Townend was disqualified from driving and decided to follow him.
The prosecutor said the woman was shouting and swearing at Townend.
Townend’s vehicle was overtaken by the woman shortly before the shooting incident.
Mr Smith said: “The defendant, still in the driver’s side, put his hand out of the driver’s window.
“He held what she thought was a gun and he shot it at the complainant’s car, smashing her back window.”
Townend, of Wheatcroft, Castleford, was arrested two days later but refused to comment.
He pleaded guilty to possession of an imitation firearm with intent to cause fear of violence, criminal damage and driving while disqualified.
Michael Morley, mitigating, said Townend accepted that he had behaved “foolishly”.
He said the BB gun belonged to the passenger who was in his car.
Mr Morley said Townend was handed the weapon by the other man and he fired it after the women had blocked his path with her vehicle.
The barrister said Townend did not intend to fire the weapon at the car.
He said: “One of the pellets must have bounced of the ground and shattered the window.”
Jailing Townend, judge Tom Bayliss, QC, said: “You were holding what looks like a very realistic handgun.
“It must have been a very frightening experience.”