A pal since childhood of state Sen. John Sampson testified Thursday that he misused his position as a paralegal in the U.S. attorney's office to try to get inside information at the request of the high school buddy who had shared a lifetime of sports, barbecues, weddings and holidays.

"It's very shameful, so embarrassing," said Sam Noel, appearing as a government witness at Sampson's corruption trial in federal court in Brooklyn, where he lamented that he had both betrayed the prosecutors he worked with for 22 years and was "testifying against a man I view as my brother."

Sampson, 47, of Brooklyn, a former State Senate Democratic leader, is charged with recruiting Noel as a mole, lying to the FBI and obstructing justice to try to cover up his theft of $188,500 from escrow accounts he controlled as a court-appointed referee in foreclosure sales.

He allegedly borrowed money from corrupt mortgage broker Edul Ahmad to replace the embezzled funds, urged Ahmad to hide evidence from investigators and leaned on Noel to get tips about a mortgage fraud case prosecutors built against Ahmad.

Noel, 48, a bearlike man with a gray goatee and deep voice, said he became friends with Sampson and his brother Derrick in 1982 when they attended Abraham Lincoln High School in Brownsville.

As kids, he said, they partied and played sports together -- so inseparable that Sampson's parents "were like my second parents." Later, it was boat rides, vacations and celebrations. They have nicknames for one another -- "NL," and "John-O" or just "J." They helped each other find jobs, and Noel campaigned for Sampson.

Noel said he won awards for his work as a paralegal on cases like the prosecution of mobster Peter Gotti, and had become a supervisor by 2011, when Sampson asked to meet with him one night in front of a neighborhood drugstore.

After Sampson emerged from his Escalade and the two exchanged "bro hugs," Noel said, a "worried, concerned" Sampson got right to the point.

"I need you to do a favor," he allegedly said, claiming he was concerned a woman might be snitching on him in the Ahmad case, and he needed to identify cooperating witnesses.

Noel said he was "shocked" at the request, and to give himself deniability, he told Sampson he would try to find out "public information." Sampson, he testified, responded, "OK, OK. But whatever you do, don't get yourself jammed up."

"He meant, 'Don't get caught,' " Noel testified.

In subsequent weeks, Noel testified, he used his government credentials to search both public and internal, confidential databases for information, and also asked two other paralegals in the office, but came up dry on witnesses and told Sampson there was no sign he was a target.

Sampson, however, had told Ahmad he had an inside source, and Ahmad eventually became an informant himself. In April 2012, Noel was suspended from his job -- but two months later, chatting in Sampson's kitchen, the senator kept pressing for advice and tips on the probe.

It was the last time the two spoke. "I was pretty much out of luck," Noel recalled. "He was still concerned about what was going on with him. That's understandable, but there was nothing I could do about it."

Noel, who now works with mentally disabled children in Queens, eventually pleaded guilty to misusing a government database. He faces up to a year in jail when he is sentenced. He closed his testimony by trying to explain why he did it.

"I've known John for over 30 years," Noel said. "I love him like a brother. I was concerned about his situation. I wanted to do what I could to help him."