David Coon, the leader of the province's Green party, filed an access-to-information request in February 2013 asking for the documents.
But Finance Minister Blaine Higgs had initially rejected the request for several reasons, including that the government considered them confidential.
Coon appealed to New Brunswick's access-to-information and privacy commissioner, who said the government should hand over the documents with some exemptions.
But the government refused and Coon filed an appeal with the Court of Queen's Bench, which has ordered the contracts be released with the exception of information that could identify the consultants and what they were paid in per diems.
"The maximum amount to be paid and the final contract amount payable under each contract is not information that interferes with the consultants' competitive edge," Judge Judy Clendening said in her ruling.
"In all other respects, the recommendations of the privacy commissioner ... are upheld and the respondent is ordered to comply."
Higgs said he had agreed in March to release that level of information, but he confirmed that the government wanted to wait for the court ruling before taking action.
"We had told Mr. Coon that we would release the reports exactly as the court has ordered," Higgs said in an interview. "The act requires us to get the consent of the consultant and they declined. So that's why we said we would release the reports, but we will not release the names or per diems of the consultant."
Higgs said the documents should be released next week.
Coon said he was happy with the ruling.
"I am pleased that Madam Justice Clendening has upheld the recommendations of the access-to-information commissioner and the public's right to know," he said in a statement.
"However, there is clearly a flaw in the Right to Information Act, which must be corrected. If we are to avoid governments hiring consultants who have a potential conflict of interest that could bias their work, their names must be on the public record."