The federal customs agent accused of waving his gun at a 10-year-old Queens schoolboy was a changed man when he returned from Iraq 10 months ago, a neighbor said.

The neighbor, who asked not to be identified, said Carlos Ugarte, 37, had been pleading with her son for help in getting stress counseling since he finished his 13-month tour of duty with the Army in May.

“He was trying to get help. He was trying to get treatment,” the neighbor said. “He asked my son if he knows someone, because he wanted to get help.”

Ugarte was charged with menacing and child endangerment for allegedly jabbing his gun into the belly of Antoine Hodges, 10, at PS 50 in Jamaica on Friday and warning him not to mess with his 11-year-old son. The boys had had an altercation a day earlier.

A shaken Antoine told The Post that he was afraid to go to school again because he believed Ugarte would be looking for him.

Ugarte’s father, Carlos Sr., denied his son pulled a gun and suggested that his grandson is just as frightened of Antoine as Antoine is of the gun-toting Ugarte.

“I don’t think he pulled his gun. He’s a trained professional. He knows how to handle himself,” the elder Ugarte said. “My grandson is also scared to go to school.”

Another family friend, Susy Ramos, 43, described Ugarte as “a good father” who confided how dangerous Iraq had been and how much he had missed his wife and two sons.

“This is not him,” Ramos said of Ugarte’s arrest. “I’ve never seen him behave in a violent way.”

Ugarte was an immigration inspector from 1990 to December 2002, when he was promoted to criminal investigator with the new Immigration and Customs Enforcement Division of the Homeland Security Department.

His career was interrupted in April 2004, when the Army Reserves called him to serve in Iraq as a staff sergeant, according to the division.

An agency spokesman said Ugarte was stripped of his badge and gun and placed on administrative duty after his arrest.

Ugarte was arraigned at Queens Criminal Court late Friday and released on his own recognizance.