First it was pizza for Rikers inmates. Now Mayor Bill de Blasio is making crime pay — with gift cards.

In a taxpayer-funded effort to make accused criminals happier in court, low-level defendants in Manhattan are being paid to rate the courtesy of judges and prosecutors — and even the temperature of the courtroom.

For completing the questionnaire — which reads like the type of marketing survey retailers give customers — participants get a $15 Dunkin’ Donuts gift card.

The $800,000 crook-coddling push is an effort by the Mayor’s Office of Criminal Justice to make the court system more user-friendly — the users being accused of crimes.

“Once again, the mayor wants to appease the criminals at taxpayers’ expense,” said an NYPD source who watched in amazement as a defendant was handed his Dunkin’ reward.

“Next thing they’ll be giving out Macy’s cards so these perps could do their holiday shopping,” the source groused.

The mayor’s survey comes amid a push for more non-jail sentences to allow the closure of Rikers Island, and efforts to reduce violence there by rewarding well-behaving inmates with pizza parties, as The Post documented in October.

A high-ranking NYPD source called de Blasio’s latest criminal justice effort “crazy,” and noted that appearing in court “isn’t supposed to be fun.”

“You want these people not to want this to happen again,” the cop said. “It’s not supposed to be a positive experience to get locked up or get a summons.”

Michael Palladino, president of the NYPD detectives union, likened the gift cards to “a nice Christmas present for our participants in the criminal justice system.”

Sergeants union president Ed Mullins said: “There’s a longstanding statement that crime doesn’t pay. We’ve now proved it does.

“It now pays for a $15 Dunkin’ Donuts card. Maybe we can give them confiscated firearms, too.

“Where is this coming from? We’re all singing ‘Kumbaya’ together? Maybe it’s time we process criminals over tea and biscuits,” Mullins said in disbelief.

Several defendants who took part in the survey recently told The Post they didn’t mind answering its 144 questions — considering the sweet reward.

“I spoke and shared my honest opinions and was awarded with a gift card, which was great,” said Keith Ware, 34, a personal trainer facing a disorderly conduct charge.

“One of the questions was something about, do you feel like the judges and everyone in there did everything they had to do? I feel like, some days, but not all days.”

Juan Cruz, fighting what he called a “bullcrap misdemeanor charge,” was in favor of efforts to improve the system. Still, he said, “I told them I’ve been here too many times to not understand the process.

“But hey, got me a doughnut and cup of coffee when I get out of here.”

Rodney Jones, 62, who said he was busted for carrying a cap gun, reasoned the gift cards are a good use of public money “because some people come here and don’t have money to eat lunch.”

But Ebony Drake, who took the survey after winning dismissal of an assault case, questioned the survey’s value, saying “some of the questions were real silly.”

“A lot of people are going to stop for the gift card, and they’re going to tell you anything to get the gift card,” said Drake, 34. “I live in [public] housing, so I could say that money could go to a thousand other things.”

The questionnaire is being administered by the Center for Court Innovation, and is part of a program begun in August.

The first phase led to the installation of signs on benches in a Manhattan courtroom where misdemeanors are handled that explain the justice system.

The final phase, planned for next year, is expected to include courtesy-training sessions for judges, clerks and court officers.

Several court officers were outraged by the survey, especially questions about how cheerful and respectful they seemed.

“It isn’t my job to be nice or make friends,” one court officer said. “It’s my job to make the courthouse run smoothly.”

Dennis Quirk, president of the Court Officers Association, also derided the notion that criminal defendants were being asked how the court personnel could better serve them.

“We don’t need any training, judges don’t need any training. We all know how to do our jobs, and we already treat people with courtesy,” said Quirk.

“Next, City Hall is going to want us to hand out ice cream cones and candy bars. Many of these people committed crimes. How much more do we want to coddle them?”

The Mayor’s Office of Criminal Justice defended disbursement of the gift cards as “compensation” for the survey participants’ time, and insisted the cost was a “minuscule” part of the overall budget.

“Small physical changes can [make] a significant impact on behavior,” Criminal Justice Director Elizabeth Glazer said in a written statement.

“If the design of our courts can enhance respect for the law, it will potentially reduce future contact with the justice system, improving our city for everyone.”

“That is what we are aiming to do now as well as working with experts to assess the effectiveness of these changes.”