Ali, 28, and his friend Ryan Hale, 27, are also standing trial accused of affray during the incident. All three men deny the charges.
Hale, who it is alleged was punched by Stokes in footage captured on a mobile phone and played to the jury on Tuesday, cycled to hospital later on Monday and was found to have sustained a 1.5 inch superficial laceration to his forehead.
Nicholas Corsellis, prosecuting, told the jury: "Mr Cunningham observed Mr Stokes's behaviour towards them". I said something like 'leave it out - you shouldn't be taking the piss because they're gay'.
Ali is alleged to have threatened Stokes' teammate Alex Hales with a bottle during the incident, while Hale broke off a metal pole from a nearby road sign after being allegedly knocked out by Stokes.
"In response one of the guys said 'Shut the f*** up and f**** off or I'll bottle you.' At the time he was holding a bottle in his right hand".
But in a statement provided to police and heard in court Wednesday, Stokes said he only stepped in after hearing two men being homophobic toward two other men. "In my statement I describe him as a gentleman with ginger or light brown hair".
"The individual seemed to be the main aggressor or was progressing forward trying to get to another individual", he told the court.
"I got a little frightened so closed the window and went back to bed".
Ali also described how, as he lay "in the gutter" having allegedly been punched by Stokes, he made a phone call to the council's CCTV office to ensure they had footage of the incident.
"I chose to intervene and asked Ryan Ali and Ryan Hale to stop abusing Kai and William".
"I decided at this point matters had become too serious to ignore and that I had to intervene to stop Ryan Ali. I can only guess I thought I was going to be attacked".
Stokes added he "felt under threat of immediate attack from both these men and I did what I did only in order to defend myself".
He identified Stokes to attending police officers, who arrested him.
The doorman said Hales asked what had happened and, after being told, said to his team-mate: "Stokesy - don't do that".