Judge orders GCSB to 'confirm all entities' to which it gave information from illegally obtained interceptions.
The top-secret international spy ring known as Echelon will have to reveal whether it received details of illegal spying on Kim Dotcom.
The order for the intelligence network to reveal its secrets comes after a new judgment into the bungled handling of the case against the alleged internet pirate.
The High Court at Auckland ordered the police to produce details either proving or discounting the existence of a live video feed of the raid after contradictory evidence from a senior police officer.
The case is now aimed at the heart of New Zealand's intelligence arrangements with the United States and the other Echelon partners - Australia, Canada and Britain.
The secret group, also known as Five Eyes, collects and analyses data from electronic networks around the world for the benefit of exchange between member countries.
The order for the Government Communications Security Bureau (GSCB) to reveal top-secret details came along with an order the spy agency would now sit alongside the police as a defendant as the court continued to probe the unlawful search warrant used in the raid on Dotcom's north Auckland mansion.
Chief High Court Judge Helen Winkelmann said the GCSB would have to "confirm all entities" to which it gave information sourced through its illegal interception of Dotcom's communications. She said her order included "members of Echelon/Five Eyes, including any United States authority".
The judgment also recorded Dotcom's suspicions he had been spied on at least six weeks before the GCSB admitted to doing so and sought details as to whether others had been swept up in the illegal operation.
The Crown had raised concerns about "secrecy", saying revealing the information could "compromise New Zealand's national security interests". Justice Winkelmann said the concerns - which included revealing how the GCSB worked with "intelligence allies" - could be managed through the appointment of Stuart Grieve QC. He was appointed by the court to view top-secret information and judge its relevance to the case.
She also cleared the way for Dotcom and his co-accused to sue the police and GCSB for damages - although she said "relief sought for the illegal search" included a copy of the data seized during the raid.
The judgment also raised questions about evidence given by Detective Inspector Grant Wormald, the officer who commanded the raid on the mansion. It said evidence he had given about possible "live footage" of the raid contradicted earlier evidence given during the hearing. The police were ordered to provide evidence from a senior New Zealand officer in the US who told an internal publication he "monitored" the raid from FBI headquarters.
Mr Wormald is also facing questions about other testimony after he assured the court there was no surveillance other than that carried out by police. The GCSB's illegal spying operation later emerged.
The Dotcom file
Kim Dotcom: Multi-millionaire, New Zealand resident and alleged internet pirate wanted by the FBI. Spied on illegally.
Justice Helen Winkelmann: Chief High Court Judge who ruled the search warrant unlawful, search and seizure illegal and has now ordered the spies to show up in court.
Hugh Wolfensohn: The GCSB spy agency's legal expert and long-time civil servant. On "gardening leave" after it emerged he learned enough in February to know the spying was illegal - but never connected the dots until after the GCSB tried to suppress it.
Detective Inspector Grant Wormald: The officer whose affidavit "contradicted" evidence he had given earlier. He led the raid.
August 2011: FBI and police start meeting to plan Dotcom's arrest.
December 2011: Illegal spying starts on Dotcom.
January 2012: Raid sees Dotcom and three co-accused arrested.
March 2012: Crown admits it used the wrong order to seize his fortune.
June 2012: Court rules police search warrant unlawful, search and seizure illegal.
September 2012: John Key apologises to Dotcom after illegal spying revealed.
December 2012: Spies told they will have to give up Dotcom secrets.