The other victim got into a fight with one of the gunmen and knocked the assailant's hat off during the struggle. In turn, the victim was shot in the abdomen by that gunman, police said.
The gunshot critically injured the victim but he survived.
Although most DNA samples from the suburbs have to be sent to State Police crime labs for analysis, the Philadelphia Police Department's Forensic Sciences Bureau agreed to process the hat as a favor to Upper Darby police.
Last month, Philadelphia police informed Upper Darby cops that they had a match for the DNA left on the hat. In a subsequent photo lineup, the victim identified Shaw as the man who allegedly shot him, Chitwood said.
As a result, Upper Darby police Friday night arrested Shaw, 22, of Stratford Street near Welsh Road in Philly, and charged him with attempted murder and related offenses. The other gunman remains unidentified.
Chitwood said he didn't know why it took more than three years for the DNA to match, but speculated that Shaw's DNA may not have been on file until recently. The state only collects DNA from those convicted of a felony.
According to online court records, Shaw was first ordered to give a DNA sample in June 2012. That sample could have been taken at any time between Shaw's 2012 conviction and his June release from prison on parole.
On Twitter: @FarFarrAway