An undercover NYPD cop is under investigation by the Internal Affairs Bureau after being caught on video kicking a fellow officer in the head while he and a group of uniformed cops were trying to help subdue a suspect at a Coney Island subway station, cops said.

The undercover anti-crime officer, whose name has not been released, could be seen on the video entering the Stillwell Avenue subway station near Mermaid Avenue on a January evening and delivering a swift kick to the head of one of his own colleagues.

The incident was first reported by DNAinfo.com.

A professional photographer who took the video, Rod Patrick Risbrook, said at least six officers pinned the scrawny teen down and started to beat him.

“He looked skinny, young, maybe somewhere between 17 and 20. No older than 22,” he explained.

Risbrook said the incident happened on January 22, at 5:20 p.m.

He told The Post cops were subduing the unidentified man, but used excessive force.

“They were punching him. He was being hurt. It wasn’t until they got him up that he said something like, ‘This is how they do! You see what’s going on here.’ ”

The cop who was kicked had been on the ground struggling to subdue the suspect, who was resisting arrest for trying to beat a fare at the subway station, the police sources said.

Two transit officers initially stopped the man, who refused to be placed in cuffs, the sources said.

A few cops from the 60th Precinct rushed to the scene to help out, according to sources.

That’s when the plainclothes officer, also from the 60th Precinct, dressed in jeans, a sweatshirt and heavy construction boots, ran through the emergency door and kicked the cop in the back of the head, the video shows.

He then reached out to rub the officer’s head before punching the suspect in the face, the video shows.

A woman off screen could be heard saying, “He kicked the cop, he kicked the cop.”

The officers were heard telling the suspect to stop resisting.

“You saw that?” the suspect is heard asking bystanders.

The officer who swung his boot has been stripped of his gun and badge pending an investigation of the incident, police said.

The NYPD declined to comment on the video or identify the suspect, who pleaded guilty to a lesser charge, which was later sealed.

The Brooklyn District Attorney’s Office said they also are investigating.

“My office is working with Commissioner Bratton to ensure that every member of the community is treated with dignity and respect,” District Attorney Ken Thompson said, in lieu of a spike in media coverage surrounding police brutality videos.