The dough is flying again at Di Fara — thanks to a guy who knows a little something about dough.

The iconic Brooklyn pizza joint reopened Thursday after the owners of the 54-year-old eatery hired an accountant who set state tax officials straight on $167,000 in unpaid taxes.

Vinny Cervone cut a deal with Department of Taxation and Finance officials after they padlocked the famed pizzeria Tuesday over unpaid taxes dating to 2014 — and was able to get the locks taken off in time for lunch Thursday.

“I came in, made an agreement, called some people up, and got the payment plan back in place,” Cervone told The Post.

Margaret DeMarco-Mieles, whose family owns Di Fara, showed up at the Midwood pizzeria with Cervone at 11:30 a.m. — two days, to the hour, after it was shut down — and began taking the locks off the door and tearing down “seized” signs posted by tax officials.

“We’re looking forward to getting everything started,” she said. “We do have to give the ovens time because we shut them off for the closing. We have to make dough. We have to prepare for the day, so we’re really excited.”

Cervone said Di Fara had a payment plan in the past after an audit cited it for unpaid taxes — but due to confusion over the amount owed, “some payments were missed.”

“New York state came in aggressively, shut them down aggressively, which they shouldn’t have done. They should have talked to them about it,” he said. “But now we’ve got to review these old sales-tax returns and get the right numbers. They might not owe any money.”

State tax officials confirmed an agreement had been reached.

“We did give the keys back to the business owner today,” spokesman James Gazzale said, although would not discuss details of the agreement.

Cervone is going to help update Di Fara’s accounting system to improve record keeping in order to avoid future tax disputes with authorities.

Cervone is now going to help update Di Fara’s accounting system to improve record-keeping in order to avoid future tax disputes.

“This way, if New York state ever comes back and says, ‘Here’s an assessment,’ we can say, ‘No,’ and show them the proof,” Cervone said.

The pizzeria’s closing got a rise out of Mayor de Blasio, who said this week he would do “anything” to get the ovens going again — and tweeted Thursday he was “glad to know the best slice in town will still be in Midwood for years to come.”

But Gov. Cuomo said during an appearance on NY1 that de Blasio had nothing to do with getting Di Fara up and running.

“No, I did not speak with the mayor about it,” Cuomo said. “The normal procedure on this is the state; this was a state tax-collection matter. So the state doesn’t work with the city on these types of issues.”