Michael Conway leaves Brooklyn Federal Court on Wednesday after being sentenced to four years in prison for wire fraud.

A Brooklyn judge sentenced an admitted fraudster to four years in federal prison for duping a family friend into investing millions of dollars in an office equipment leasing scam.

Michael Conway, 41, cried profusely throughout his sentencing hearing in Brooklyn Federal Court on Wednesday as he learned his fate from Judge William Kuntz — 48 months in prison.

Conway, the president of Choice Office Solutions, pleaded guilty in February to one count of wire fraud for forging the signatures of people, including Mets Chief Operating Officer Jeff Wilpon, on fake lease agreements.

“Embarrassingly, I helped fund his business,” said David Rich, whom Conway fooled into dishing out over $3.5 million to purchase the materials.

Rich, 47, trusted Conway since he was the former brother-in-law of a childhood friend.

“You’re selfish, greedy and egotistical,” said Rich, who asked Kuntz to show no leniency during sentencing.

Conway, who faced up to 20 years in prison, apologized to his victims for his 17-month-long scam, which he attributed to a “real drug and alcohol problem.”

“A significant sentence is necessary… for his reckless disregard for the law,” said Kuntz, who also ordered Conway to repay Rich every cent of the stolen $3,559,493.40.

The judge ordered him to attend an outpatient treatment program, not to drink or take drugs unless prescribed and to surrender all firearms.

Conway also must pay back $1,203,516 to De Lage Landen Financial Solutions Partners (DLLFSP), which he tricked into financing a forged Mets lease — with Wilpon’s first name spelled incorrectly — for similar office equipment.

The judge released Conway from court after he rendered the 48-month sentence and ordered him to surrender himself on March 20.