NEW YORK, March 6 (Reuters) - The government's star witness in the criminal trial of five former Bernard Madoff employees is a lifelong liar whose capacity for falsehood rivaled only that of Madoff himself, lawyers for two defendants told a federal jury on Thursday.

Making closing arguments in New York federal court after five months of testimony and a six-hour government summation, lawyers for the defendants sought to undermine the testimony of former Madoff lieutenant Frank DiPascali, who spent weeks describing how all five defendants were complicit in a dizzying array of fraudulent activity.

Larry Krantz, who represents computer programmer George Perez, called DiPascali a "con man's con man" and said, "Mr. Perez was used, abused and manipulated by two of the greatest criminal masterminds of all time: Bernie Madoff and Frank DiPascali."

Eric Breslin, the lawyer for portfolio manager Joann Crupi, referred to DiPascali's "corrupt and rotten essence, which permeated this courtroom for a month."

The five defendants are charged with helping perpetrate a massive Ponzi scheme at Madoff's investment firm. In addition to Perez and Crupi, they include another computer programmer, Jerome O'Hara; portfolio manager Annette Bongiorno; and the firm's operations director, Daniel Bonventre.

All five have argued that they were duped by Madoff into thinking the firm's investment advisory business was legitimate and only later found out that no trading took place in that unit.

Madoff himself is serving a 150-year prison sentence after pleading guilty to the scheme, which cost investors approximately $17 billion in principal losses when it collapsed in 2008.

Prosecutors have said Perez and O'Hara wrote computer programs that generated millions of false trading records to fool U.S. Securities and Exchange Commission investigators and independent auditors.

Those programs included code that assigned random transaction numbers, time stamps and even banking counterparties to make the trading activity seem more real. There could be no legitimate reason to create such code, Zach said in closing arguments earlier this week.

The government also accused Crupi of backdating countless fake trades in customer accounts, helping to forge documents for auditors and overseeing cash flow in the bank account where the fraud was centered.

Both Krantz and Breslin argued that their clients were just like many other employees at Madoff's firm who participated in the fraud without realizing what was happening, thanks to Madoff's talent for deception.

Breslin invoked Buell Frazier, the man who unwittingly drove Lee Harvey Oswald to the book depository in Dallas on the day he assassinated President John F. Kennedy and accepted Oswald's statement that the bag carrying his rifle actually contained shower rods.

"There were a lot of blameless people at Madoff Securities," he said.

When Perez and O'Hara became suspicious in 2006 about how their programs were used, Krantz said, they told DiPascali and Madoff they were no longer "comfortable" writing programs that altered past statements.

Krantz described that as a courageous move. Prosecutors, however, have characterized it as an act of extortion, not bravery, in an effort to get salary raises.

Krantz also pointed out that DiPascali admitted under cross-examination that he had repeatedly lied to Perez and O'Hara about the nature of their work to ensure they would help him perpetuate the fraud.

"If they're in on the fraud, why on earth does Frank DiPascali have to lie over and over to get them to do his dirty work?" Krantz said. "It makes no sense."

DiPascali, Krantz added, has lied under oath before, when he testified before the SEC regarding the firm's purported trading strategies. He also changed his story several times between his first meetings with government agents and his testimony at the trial, Krantz said.

"This is not a typical human being," Krantz said. "This is a human being who lost a grasp of truth and falsity a long time ago."

Closing arguments by defense lawyers are expected to last several more days.

The case is USA v. O'Hara et al, U.S. District Court, Southern District of New York, No. 10-cr-0228.