Shaheem Isaac, 24, was jailed for eight years after a court heard how the firearm was discharged in the daytime attack at a house in Leeds
Fellow gang member, 17-year-old Emile Riggan, was sent to a young offenders institution for 12 months for his role in the shooting on July 16 last year.
Riggan was wounded in a revenge shooting later the same day.
Leeds Crown Court heard how the teenager filmed himself on a mobile phone “boasting” about his injuries as he was taken to St James’s Hospital.
The Recorder of Leeds, Judge Guy Kearl, QC, agreed to lift a reporting restriction to allow the media to identify Riggan.
Sentencing the pair, the judge said: “Guns maim. They kill. As do knives and machetes.
“This was gang warfare on the streets of Chapeltown using loaded guns as weapons.
“The possession of firearms is a grave danger to our society.
“Deterrent sentences are often required for those who bring the threat of violence to the streets of West Yorkshire.”
The third defendant, a 15-year-old male who cannot be named, will be sentenced next month.
The court heard the background to the shooting may have been an ongoing feud between the defendants’ gang and a rival gang led by Leeham Stewart.
After being arrested the 15-year-old told police he believed he had been stabbed by Leeham Stewart.
The three defendants travelled from an address in Chapeltown in a Ford Ka, which was fitted with false number plates, to a house on Roundhay Grove where they smashed a window.
They then drove to the house at Devon Close, in Woodhouse, where a shot was fired into the guttering.
The incident happened as members of the public, including children, were in the street
Police received 999 calls from people who witnessed the incident but wished to remain anonymous.
Officers spoke to a woman at the house who said she feared the attack may be related to her son, who was out at the time.
The Ford Ka was abandoned later that day on Hill Top Place, Hyde Park. The defendants were seen removing a number of bags from the car.
DNA from the two teenagers was later recovered from the car. CCTV footage also showed the defendants being picked up nearby in a taxi. Police received reports that shots had been fired in Spencer Place, Chapeltown, later the same day.
Prosecutor Michael Morley said: “Riggan himself had been admitted to hospital with gunshot wounds.
“The precise motives are not clear but may be related to wider criminality and a feud between criminals.”
A judge lifted reporting restrictions to allow Emile Riggan to be publicly identified.
The teenager “boasted” as he filmed himself on a mobile phone as he was taken to St James’ Hospital.
He underwent surgery and recovered from his injuries.
Isaac, 24, of Louis Grove, Chapeltown, was jailed after pleading guilty to possession of a firearm with intent to endanger life and criminal damage.
Riggan, who turns 18 today, pleaded guilty to possession of a firearm with intent to cause fear of violence.
He was sent to a young offenders institution for 12 months.
The judge said: “The principle of open justice is most important. This message will get out.”
The third defendant, a 15-year-old also pleaded guilty to possession of a firearm with intent to cause fear of violence.
After the case, Detective Inspector Andy Farrell, who led the investigation, said: “These convictions and sentences are an excellent result for the community who were put in fear by these incidents. A comprehensive investigation by specialist detectives built up a detailed picture of the involvement of those convicted, and we believe the strength of that evidence led to their guilty pleas.
“The criminal use of firearms on our streets cannot and will not be tolerated.”