A Staten Island man who won a $17 million Lotto jackpot in 2007 approached Bernie Madoff a short time afterwards about investing some of the winnings in the Ponzi king’s crooked investment advisory account.

But when Madoff got greedy and told Barry Fleischmann he wanted “all of it,” the former Wall Street worker wouldn’t give him a penny, Madoff’s former comptroller told a Manhattan jury on Wednesday.

“After [Madoff Securities] collapsed in 2008, a lot of us said Barry Fleischmann won the lottery twice,” testified Enrica Cotellessa-Pitz, an admitted fraudster-turned-government-witness in a Manhattan federal court trial of five former Madoff co-workers.

Cotellessa-Pitz said that Fleischmann — who opted to collect a lump-sum Lotto payment of $8.8 million — was already investing in stocks through Madoff Securities when he struck it rich.

Fleischmann, 53, could not be reached for comment, but his wife, Sharon, told the Post she has doubts with Cotellessa-Pitz’s version of the facts.

“We didn’t have the type of money that Bernie takes because he was taking $10 million at a time,” she said. “And we weren’t stupid enough to give him every penny we had.”

Interestingly , Barry Fleischman told the Post during a 2007 press event he “can’t top that story,” referring to a fellow Lotto winner from Long Island who had just told a rag-to-riches tale of how she was on the verge losing her home before finding a $20 bill and using it to win her $2,000-a-week-for-life jackpot.

“Our story is only compelling now because of what happened afterwards,” Sharon Fleischman said. “We had no idea about Bernie or what he did.”

Cotellessa-Pitz also made another bombshell revelation in court, discussing how one of her former co-workers was a regular George Constanza.

She said that office worker Jeffrey Ferraro, stepson of former Madoff operations chief Daniel Bonventre, spent much of his workday sleeping under his desk. Bonventre is one of the five co-defendants on trial for fraud and other charges.

“[Ferraro] would sleep during the day,” said Cotellessa-Pitz. “He would sleep by his desk, under his desk. It was going on for years.”

Cotellessa-Pitz — a government witness who copped a plea to falsifying company records and making bogus submissions to government regulators – claimed she was unaware Madoff was running a Ponzi scheme.

She also said other co-workers complained about Ferraro’s work-time siestas.

“He was unable to do his work in a timely fashion,” she said. “..A lot of employees saw him sleeping. There were a lot of comments made about it.”

She also said Madoff and Bonventre were well aware of the matter — but did nothing.

“ I saw [Madoff] look in at Jeff while he was sleeping,” Cotellessa-Pitz said.

Besides Bonventre, also on trial are Madoff’s former secretary Annette Bongiorno, office worker Joann Crupi, and computer programmers George Perez and Jerome O’Hara.