The complaint alleges the town of Bernards discriminated against the Islamic Society of Basking Ridge by amending its zoning ordinances and treating the group differently than it treated other religious groups.
Bernards, an upscale community in north-central New Jersey, is about five miles from Bedminster, where President-elect Donald Trump held meetings with potential Cabinet nominees over the weekend at his golf course.
During the presidential campaign, Trump suggested requiring Muslims in the U.S. to register their religious affiliation.
Tuesday's complaint alleges the town "applied different substantive requirements than it had in evaluating previous applications" by other religious groups.
It also charged the town discriminated by changing its zoning laws after the Islamic group's application to require houses of worship in residential districts to be at least six acres — larger than the lot the group had purchased in 2011.
Eight of 11 other houses of worship built before the zoning laws were changed are on lots smaller than six acres, the complaint alleges.
In a statement released Tuesday, the Bernards Township Committee said it "maintains that the Planning Board denial was based on legitimate land use and safety concerns which Plaintiffs refused, and to this day, refuse to address."
It also contended the Justice Department investigation "was not conducted in an objective manner designed to seek the truth, but rather only to support and bolster the ongoing (Islamic Society of Basking Ridge) civil lawsuit."
The Islamic Society sued Bernards in March, several months after the group's application to build the mosque was denied after more than three years and 39 public hearings.
That lawsuit alleged town residents opposed to the mosque made references to terrorism and questioned what children would learn in the mosque.
The town responded in a court filing that it was more concerned with issues such as storm water management, lighting and fire safety.
This story corrects that the Islamic group's lawsuit was filed in March, not April.
Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.