Joaquin “El Chapo” Guzman once had the brother of a leader of an allied cartel killed because he didn’t shake his hand — a hit the sparked a turf war between the Sinaloa and Juarez enterprises, a witness testified in Brooklyn court Monday.

The pint-size drug lord and head of the world’s most powerful cartel felt disrespected after his 2004 meeting with Rodolfo Carrillo Fuentes, whose brother Vicente Carrillo Fuentes ran the Juarez cartel, said turncoat Sinaloa underling Jesus “El Rey” Zambada.

“When [Rodolfo] left, Chapo gave him his hand and said, ‘See you later, friend,’ and Rodolfo just left him standing there with his hand extended,” Zambada told the jurors.

Zambada has been testifying at Guzman’s drug-trafficking trial since last week.

He recalled how his brother and Guzman’s alleged right-hand man, Ismael “El Mayo” Zambada, told him after the snub, ” ‘Mi compa Chapo is very upset.’ He said Chapo said he is going to kill him because he couldn’t take Rodolfo anymore.”

Fuentes was murdered that year at Guzman’s behest, causing the Juarez and Sinaloa cartels, which until that point had formed an alliance, to fall out, Jesus Zambada said.

Vicente then had Guzman’s baby brother, Arturo Guzman Loera, killed in retaliation in late 2004 — prompting an all-out turf war between the two Mexican cartels.

Meanwhile, Jesus Zambada also testified that he was ordered to pay $250,000 in bribes to the Mexican military, which sought to capture Guzman while he was on the lam between 2001 and 2014.

A lieutenant colonel in the military demanded “$250,000, and if we don’t do that, they’re going to capture him,” Jesus Zambada recalled telling his brother.

The cash was paid and “the operation was aborted,” he added.

As a thank-you, Guzman invited Jesus Zambada and his wife to breakfast at his sprawling hideout in the pine trees of the remote Sinaloa mountains, the witness said.

Guzman boasted about his obsession with guns — including his bazooka, AK-47s and his favorite, a blinged-out .38-caliber pistol engraved with his initials, Zambada said.

“On the handle were diamonds,” he said.