Linda Walker, 48, head of food technology at New Park special school in Salford, Greater Manchester, fired at the pavement during a stand-off outside her home last August. She believed the gang had vandalised her garden.
Three appeal judges set aside her six-month prison sentence and granted a conditional discharge, but refused her permission to challenge her convictions of affray and possessing a firearm with intent to cause fear of violence.
Lord Justice Rose said the judges had taken into account her "fragile mental state", caused by work pressures.
She had taught emotionally disturbed children with behavioural problems for three years and her school had been placed under special measures.
He also said she was subject to mood swings and emotional upset caused by her age, and that no public interest would be served by her continued incarceration.
A spokeswoman for the General Teaching Council said the police would automatically have referred her conviction to the Department for Education and Skills, which would decide whether her case raised child protection issues, in which case the matter would be considered internally. If not, the GTC would consider it. Either route could lead to a ban from teaching.
Salford council said it would continue with disciplinary proceedings.
Walker sat in the court dock and smiled at her family sitting at the back of the courtroom as Lord Justice Rose, Mr Justice Gibbs and Mr Justice Stanley Burnton announced their decision.
She had informed police that she had received nuisance phone calls abusing her family, that her garden shed had been broken into, and that her car and garden had been vandalised.
But no evidence was produced at the trial that any of the youths she confronted had been involved in the vandalism.
Walker, from Urmston, in Greater Manchester, was jailed at Manchester Crown Court on March 29.
Giving his ruling, Lord Justice Rose said the use and discharge of firearms in a public place was a cause of great public concern.
"There can be no excuse whatever for what you did that night," he told her.