In a landmark move, the Federal Court told six firms to divulge names and addresses of those who downloaded The Dallas Buyers Club.
The case was lodged by the US company that owns the rights to the 2013 movie.
The court said the data could only be used to secure "compensation for the infringements" of copyright.
In the case, which was heard in February, the applicants said they had identified 4,726 unique IP addresses from which their film was shared online using BitTorrent, a peer-to-peer file sharing network. They said this had been done without their permission.
Once they received the names of account holders, the company would then have to prove copyright infringement had taken place.
The judgment comes amidst a crackdown by the Australian government on internet piracy.
Australians are among the world's most regular illegal downloaders of digital content. The delay in release dates for new films and TV shows, and higher prices in Australia for digital content, have prompted many Australians to find surreptitious ways to watch new shows.
The ISPs involved in the case, including Australia's second-largest provider iiNet, said releasing customer information would be a breach of privacy and lead to what is known in the US as "speculative invoicing".
This is where account holders are threatened with court cases that could result in large damages unless smaller settlement fees are paid.
The ISPs argued also that the monetary claims which the US company, Dallas Buyers Club LLC, had against each infringer were so small "that it was plain that no such case could or would be maintained by the applicants".
But Justice Nye Perram ruled that the customer information could be released on condition it was only used to recover compensation for copyright infringement.
"I will also impose a condition on the applicants that they are to submit to me a draft of any letter they propose to send to account holders associated with the IP addresses which have been identified," he ruled.
Justice Perram said the ruling was also important for deterring illegal downloading.
"It is not beyond the realm of possibilities that damages of a sufficient size might be awarded under this provision in an appropriately serious case in a bid to deter people from the file-sharing of films," he said.
The case came to court after Dallas Buyers Club LLC contacted iiNet and other ISPs, asking them to divulge customer details without a court order. The ISPs refused.
The ISPs have yet to say if they will appeal against the court ruling.
Professor of Law at the University of Technology, Sydney, Michael Fraser said it was an important judgement for ISPs and customers.
"If this [judgement] is upheld then the days of anonymous pirating may be over," Prof Fraser told ABC TV.
An Australian court has ordered internet service providers (ISPs) to hand over details of customers accused of illegally downloading a US movie.