Three gunmen identified as leftist terrorists shot and killed an American naval noncommisoned officer and a Turkish citizen yesterday in an ambush in a residential district of Istanbul, police said.

One of the attackers was killed in a gunbattle with police following the shooting and the two others were captured. Three security agents and a passer-by were reported wounded.

The dead serviceman, Navy Chief Petty Officer Sam Novello, 56, of Erie, Pa., was the seventh American killed by Turkish terrorists in the past year. A friend of Novello's, Ali Sami Baydar, also died in the hail of bullets outside Novello's home in the Etilar district of Istanbul.

Police said the gunmen were members of the underground Marxist-Leninist Armed Propaganda Union, an extreme leftist organization that has claimed responnsibility for the murders of other Americans, including a serviceman and three civilian engineers in December and two servicemen last April and May.

Novello had been stationed in Turkey for the past 12 years. Witnesses said he and Baydar were about to step into the American's car when the three gunmen opened fire. Both men were killed instantly and the attackers fled on motorcycles.

Alerted by the sound of gunfire, police patrolling nearby gave chase and captured the attackers after a shootout a few miles away.