Terence Mooney QC said the accused - Kevin Murray, 44, and Martin Connolly, 25, - "randomly abandoned" items such as clothing close to the scene of the shooting which contained their DNA.
These items, which included the gun used to carry out the double kneecapping and a vehicle police suspect they drove to the scene, were abandoned when the PSNI rushed to the area following a 999 call from the victim.
Murray, from Newtown Street in Newtownstewart and his co-accused Martin Connolly, from Evish Grove in Strabane, have both been charged with four counts, namely wounding with intent to cause grievous bodily harm, possession of a firearm with intent, aggravated burglary with intent to inflict grievous bodily harm and criminal damage.
The charges arise from a gun attack carried out in the Lisnafin Park area of Strabane on 19 April, 2010, during which a flat was targeted and the male occupant was shot in both knees.
The non-jury Diplock trial held at Belfast Crown Court on Thursday heard that around 11.30pm on the evening in question, police received a 999 call from the male occupant, who claimed people were trying to break into his flat.
Mr Mooney said: "The police officer who received that call could hear noises in the background which would be consistent with the caller's complaint that his flat was under attack."
A recording of the call was played during the trial, where the victim can be heard saying: "Someone is kicking my door. They are kicking my door. Come quickly."
Police responded immediately, and when they arrived at the flat a short time later, they discovered the injured man lying outside.
Mr Mooney said: "He has injuries to both his knees and it was evident this was the result of gunshot wounds. He was bleeding heavily."
One of the officers who tended the injured man told the trial that when he arrived at Lisnafin Park, he saw a male lying in the front garden on his back.
He said: "His trousers were pulled down around his knees. There was blood on both his legs. I went to administer First Aid to him. He told me what happened. He was calm and quiet.
"He told me he was taken from the flat by three men and was shot in the legs in the garden."
The victim was initially taken to the Altnagelvin Hospital in Derry, but he was later transferred to the Ulster Hospital in Dundonald.
The scene was examined by officers investigating the shooting, who discovered a strange car in the area that had apparently been abandoned.
The Volkswagen Golf contained a plastic bottle filled with petrol and other items.
It is the Crown's case that the car was abandoned in the immediate aftermath of the shooting by the assailants, who had to flee the area on foot as their escape route was cut off by the approaching police vehicles.
During a detailed search in and around the scene of the shooting, officers also discovered a glove, a hat, a rucksack found in shrubbery which contained a handgun, a magazine with a round of live ammunition, and several items of clothing. Also found in a dog waste bin was a scarf.
Mr Mooney said that after the items were forensically tested, items of clothing found at the scene - including a beanie hat, hoodie and tracksuit bottoms - could be connected to Murray.
The prosecutor told Judge Corinne Philpott: "A major DNA profile was obtained from these items and that major profile matched the DNA profile of Kevin Murray."
Mr Mooney added a DNA profile taken from other items found at the scene matched the profile of Connolly.
He told the court that firearms residues were also found on some items, which was the same residue recovered from the weapon and discharged cartridges.
Both men were arrested two years after the shooting and denied involvement in the incident.
Mr Mooney, however, said: "The Crown case is that each of the accused was a joint participant in an enterprise which involved an attack upon [the victim's] home, taking him out of his home and when he was defenceless and vulnerable, they shot him in the back of both knees."