Logan Head, of Hawthorne Road, Tipton and Joshua Baker, of Burton Road in Dudley, both aged 19, deny possessing a firearm with intent to endanger life and an alternate count of possessing a firearm with intent to cause fear of violence.
The jury heard pellets were fired from a stolen Fiat 500 towards a bystander outside a convenience store in Stowheath Lane, Stow Heath, at around 10.15pm on July 22, 2021, injuring a man in the arm.
Prosecuting, Nicholas Tatlow QC, said Head was driving the car, while Baker was a passenger and a third man, Ian Ferguson pulled the trigger of the sawn off shotgun, hitting the man with the pellets. Ferguson had earlier admitted his part in the offence.
Mr Tatlow said: "The prosecution case is that Head and Baker were involved in the shooting and that they were knowingly involved in it."
Jurors were told how the Fiat later 'crashed' in Hall Lane, Tipton, before two men allegedly ran from the vehicle, with a witness statement to the accident from a resident identifying the car as one that had been 'cruising around the estate' in the last few days.
A spent shotgun cartridge located in the rear footwell was 'no doubt the cartridge that was fired' from the car, Mr Tatlow alleged.
DNA found on the gun linked a fourth man Dylan Ireson, to the case, Mr Tatlow said. Ireson, 23, of Uplands Avenue, Wolverhampton had previously admitted an offence involving possession of a gun between July 21 and August 7.
Ring doorbell footage captured all four men arriving at Baker's home, with Ferguson grasping an item allegedly the 'same general size and shape' of the weapon used in the shooting.
The court was told how police arrested Baker at his home and searched the property on August 6.
Detective Constable Gemma Fellows who investigated the case presented CCTV evidence to the court in which she identified all the accused and the car by its distinctive markings. She also identified Head and Baker from the doorbell footage.
The trial continues.