Dramatic bodycam footage played in court Tuesday shows the harrowing moment a bleeding FBI agent — shot while on an undercover stakeout in Brooklyn — desperately pleads with fellow law enforcement officers to get him to a hospital.

“I’m gonna die, I’m gonna die,” FBI special agent Christopher Harper desperately told responding NYPD officers after he was shot in the shoulder in December 2018 — allegedly by Crips gangbanger Ronell Watson.

“I’m not doing well,” the agent gasps as he sinks to the ground while the officers, including trial witness Andre Morris, tell him he’s not going to die.

“No exit, the bullet’s in me,” he tells them.

Morris reviewed the footage with jurors during Watson’s attempted murder trial and pointed out the bullet hole in Harper’s back. The video shows blood seeping into the agent’s red sweatshirt as he describes his shooter after the shooting, which was captured on surveillance footage.

Harper’s wife, Jessica Lasek, testified earlier Tuesday that she’d been FaceTiming with her husband, who dropped his phone just before he was shot.

“I heard a muffled voice, and then the next thing I heard was loud popping,” Lasek said, her voice breaking as she remembered him next screaming, “I’m shot, I’m shot, call 911.”

Harper suffered a collapsed lung, a broken rib and broken shoulder blade but survived the shooting and is expected to testify.

While prosecutors — who include US Attorney Richard Donoghue himself — say Watson shot Harper in an “attempted execution,” defense attorney Benjamin Yaster said his client “isn’t a murderer or an assassin.”

The lawyer said in her opening statements that his client reached for his gun after a strange car with tinted windows started speeding toward him and he panicked.

“Does it make sense that Ronell Watson would attempt to murder someone in front of his home, which was decorated for Christmas and outfitted with his mother’s security cameras?” Yaster asked.

Watson faces up to life behind bars if convicted.