The chairman of the Brooklyn Music School has to pay the piper for bugging his estranged wife’s iPhone.

Crocker Coulson was slapped with a nearly $500,000 verdict by a Brooklyn federal jury, which found he violated anti-snooping laws by secretly installing software that let him spy on the mother of his two kids, tobacco heiress Anne Resnik.

Jurors ordered Coulson to pay Resnik $200,000 in compensatory damages, $200,000 in punitive damages and another $41,500 in statutory damages under the Electronic Communications Privacy Act.

The latter amount represents a penalty of $100 a day for each of the 415 days that he illegally accessed her phone between June 29, 2012, and Oct. 31, 2014.

In addition, Coulson — the former president of the CCG Investor Relations firm and the current chair of the Brooklyn Music School’s board of trustees — was also ordered to pay damages of $10,000 each to Rensnik’s mom, sister and psychiatrist, whose communications with her were also intercepted.

The hefty award, handed up following a three-day trial earlier this month, was just the latest punishment for the 55-year-old’s “I Spy” tactics against Resnik, 54, whom he sued for divorce in 2014.

Last year, a Brooklyn Supreme Court judge ruled the Yale grad and former Fulbright scholar had forfeited any claim to the fortune Resnik inherited from her late father, Frank Resnik, who died in 1995.

Frank, a former Philip Morris research chemist, rose to become president and chief executive of the Fortune 500 company and was in charge when it acquired General Foods and Kraft during the 1980s.

“The court is mindful that [Coulson] probably never contemplated that his initial investment of approximately $50 of spyware would start him on this path or have such dire consequences for his financial future,” Brooklyn Supreme Court Justice Jeffrey Sunshine wrote in his ruling.

“However [his] conduct in this litigation both shocks the consciousness of the court and offends all semblance of judicial integrity.”

Resnik’s divorce lawyer, Raoul Felder, had uncovered Coulson’s scheme by combing through his financial records and finding a $50 PayPal charge for software called OwnSpy, which let him turn her phone into a remote microphone so he could listen in on conversations.

Coulson also installed another program, called mSpy, which gave him access to her emails, text messages, photos, GPS location data and other information, according to the invasion-of-privacy suit Resnik filed in 2017.

Coulson’s lawyer, Brian King, said the “alleged spyware use was done to find out about his wife’s extramarital affairs” and described the verdict as excessive because there was no evidence Coulson “gained any financial benefit from it.”

Resnik’s federal court lawyers didn’t respond to requests for comment, but Felder said of the affair allegations: “I find that hard to believe given the enormous volume of different people that he was taping.”