It is claimed Ezra Abeka-Soares and Morgan Mockford, both 18, were caught on CCTV on the evening of May 7 this year, ambushing Elijah Dornelly in a busy high street in Walthamstow, east London.
Two other youths also attacked Mr Dornelly, who was fatally stabbed in the stomach.
Giving evidence in court, Abeka-Soares, of Caxton Road, Southall, said he felt intimidated by the other teenagers, who were wearing hoodies.
Prosecutor Jonathan Rees asked: "What was it about the young man with the hood up that made you concerned?"
To which Abeka-Soares replied: "Well at that time when I saw the two of them walking up towards us, I was kind of panicked, I felt intimidated, it was just adrenalin that was rushing through me."
He added: "Basically they was kind of slouched and that kind of signalled that he might be armed."
When asked by Mr Rees if he was going to attack them first just in case, Abeka-Soares replied: "I had instinct, I had a feeling in my gut - we couldn't risk running off and getting stabbed from behind.
"This wasn't planned, I didn't know these youths."
Mr Rees went on to ask: "You tried to hit him, you tried to hit him hard, didn't you?"
"No it was just a little swing, I wasn't trying to hit him hard," Abeka-Soares replied.
The 18-year-old said he pulled a baton out of his bag and denied he was armed with a knife.
The jury were told of how Mockford and Abeka-Soares were outside of their patch selling around £1,400 worth of drugs that night.
During the incident, Mr Dornelly sustained a cut to a major blood vessel in his stomach and died in hospital less than two hours later.
Abeka-Soares and Mockford, of Randolph Road, Walthamstow, east London, both deny murder.
The trial at the Old Bailey continues.
Keep up to date with the latest news in west London via the free getwestlondon app.
You can even set it to receive push notifications for all the breaking news in your area