Arturs Lakstigala could be seen on CCTV footage pushing people during the incident before firing the fake weapon into the air and pointing it at a teenager's head.
Leeds Crown Court heard the incident began after two groups of young people had been drinking vodka on a recreation ground in Lupset, Wakefield, on July 3 this year.
Rupert Doswell, prosecuting, said members of both groups became drunk and began arguing.
Fighting broke out in the area of Chantry Road and Waterton Road.
Lakstigala's home is close to where the disturbance took place and two of his relatives were involved.
The 38-year-old defendant came out of his home and was seen pushing a female into some bushes.
He then went back into his house and returned with the fake weapon in his hand.
The prosecutor said he pointed it towards the sky and fired two shots.
He then pointed the weapon directly at the female's head.
Mr Doswell said: "The prosecution say it must have been extremely distressing for those in close proximity to him."
Armed police were called to the area.
Lakstigala spoke to the officers and he told them it was not a real gun and that it "just made a bang."
A blank firing pistol and two blank cartridges were recovered from outside of the property.
Lakstigala, of Waterton Road, pleaded guilty to possession of an imitation firearm with intent to cause fear of violence.
Eddison Flint, mitigating, said Lakstigala has no previous convictions and had been in custody for more than five months since his arrest.
He said: "The defendant is wholly remorseful for what he did."
Lakstigala was given a ten-month prison sentence, meaning he will be released from custody on licence as he has served half of the sentence on remand.
Judge Simon Batiste said: "There was a considerable degree of provocation.
"I accept that your motivation in doing what you did was to end this incident and protect your family.
"But you did go beyond what was acceptable in doing that."