The first shooting happened at 4:40 p.m. inside Peter's Tire & Rim Shop on Linden Boulevard in East New York.
Police say 45-year-old Carl Lastorino walked in, said "This is for you, Peter" and opened fire.
He fired several times, hitting the 49-year-old shop owner twice, in the right shoulder and hand.
He is in stable condition at Brookdale Hospital.
Just 10 minutes later, the gunman tried to get inside a livery cab at the intersection of Flatlands and Louisiana avenues about a mile away.
A responding sergeant and officer saw the suspect trying to get into a livery cab with a gun and order him to stop and drop his weapon.
The suspect matched the description that was just put out over the police scanners.
Police say Lastorino turned and pointed his .38-caliber revolver at the officers, stating, "You're not taking me alive."
Each officer fired once, striking Lastorino twice in the chest. He was pronounced at Brookdale Hospital.
A revolver was recovered next to the suspect's body. A second .38-caliber handgun and the suspect's jacket were recovered from the back seat of the livery cab.
The driver was not injured.
As for the gunman's victim, Dept. Police Commissioner Paul Browne tells Eyewitness News that he has a criminal record for armed bank robbery, reckless endangerment and narcotics. All those incidents happened in the early to mid 1980s.
Investigators are trying to figure out if his past had anything to do with Monday's shooting.