The Justice Department said on Friday it will seek a court order to force Apple Inc. to help unlock an iPhone seized as part of a New York drug investigation, another sign the fight between Washington and Silicon Valley over encryption is far from over.

Apple’s lawyers fired back that they intend to press the federal prosecutors to explain exactly why they can’t get into the iPhone on their own and want the names of any companies that are helping with the effort, citing the recent announcement by the Federal Bureau of Investigation that it had found a way to open a San Bernardino, Calif., terrorist’s cellphone.

How Encryption Works—and How It Can Be Bypassed The debate between privacy and national security has never been more heated, with Apple and other tech firms going up against the government. So how are text messages encrypted, and what are the controversial “backdoors” that could allow access to them?

“The government continues to require Apple’s assistance in accessing the data that it is authorized to search by warrant,’’ federal prosecutors in Brooklyn wrote to U.S. District Judge Margo Brodie.

The Brooklyn case emerged as a legal test in the fight over encryption and privacy last year, but it was overshadowed for months by a bigger fight over the locked iPhone of Syed Rizwan Farook, who along with his wife killed 14 people and injured 22 others in a shooting at a Dec. 2 holiday party of county workers in San Bernardino.

In the California case, the Justice Department had gone to court to try to force Apple to write a piece of software to help them open that phone but abruptly backed out of that legal confrontation when an unidentified third party showed the Federal Bureau of Investigation a way to access the phone’s data.

The new filing shows that while the political heat surrounding the encryption issue may have dimmed with the end of the San Bernardino case, the government is pushing ahead with its legal strategy. By continuing to fight the Brooklyn case, the Justice Department hopes to win one or more court rulings upholding its authority to compel companies like Apple to assist in investigations by opening devices or decrypting data.

Lawyers for Apple said they were disappointed but not surprised by the government’s move, and that the courts should be skeptical about the government’s claims of needing Apple’s help to open phones, given what happened in the San Bernardino case. The Apple lawyers said they want government officials to provide much more detail about investigators’ efforts to open the New York phone.

An Apple lawyer said the company plans to try to force the government to answer specific questions about its phone-hacking efforts, including what companies and government agencies it has consulted with and what methods it has tried. It wants officials to explain why they believe only Apple can open the phone.

The Brooklyn case represented the first open break between the two sides on the issue of locked iPhones. Starting in 2008 and lasting until late last year, Apple had helped federal agents open dozens of locked iPhones seized in criminal investigations. But when the judge in the Brooklyn case questioned whether the government had the authority to demand such cooperation, Apple began resisting the orders. A February court filing indicated there were at least a dozen current cases in which federal agents were trying to force Apple to help them open iPhones.

Both sides are preparing for the issue to eventually reach the Supreme Court, but it is impossible for the Justice Department or Apple to predict which phone or which case might be the one that wends its way through the court system and reaches the high court.

Earlier this week, FBI Director James Comey said in a speech that a newly discovered method for opening that phone, a model 5c, doesn’t work on newer versions of iPhones, such as the 5s or 6 models. An Apple lawyer on Friday said the company still doesn’t know how the FBI cracked that phone.

In the drug case, Magistrate Judge James Orenstein ruled that the U.S. didn’t have the authority to force Apple to help them access data on the phone. The Justice Department wants Judge Brodie to review the issue.

The case involves an iPhone 5s that was seized from Jun Feng as part of a 2014 drug investigation. Mr. Feng pleaded guilty last year, but both sides agreed the legal dispute surrounding the phone still needs to be resolved.

Investigators often want to examine suspects’ phones to look for texts or photos of additional evidence of crimes. Agents also may search a phone’s contact list to determine if it provides other suspects worth pursuing.

After he was arrested, Mr. Feng told agents that he didn’t remember the phone’s passcode, leading investigators eventually to seek Apple’s help. Mr. Feng, who is due to be sentenced in the case in May, only recently learned that his otherwise pedestrian drug case had become the focus of a high-profile legal fight over privacy in the digital age, according to someone close to the case.

The technical issues in the Brooklyn case are somewhat different than in San Bernardino because they involve different iPhone hardware and software. Apple has a technique for pulling data from the Brooklyn phone but is resisting applying it, saying compelling it to do so would amount to government overreach and an invasion of customers’ privacy.

In the California case, prosecutors were insisting Apple write a new piece of software to let them bypass the passcode security features.

Even though the prosecutors’ demands of Apple were more limited in the Brooklyn case, Magistrate Orenstein still found that prosecutors had exceeded the authority of a 1789 law called the All Writs Act that prosecutors had used as the legal basis for their demand. In a 50-page ruling issued in February, the judge concluded Congress had previously considered giving the government such authority and decided not to do so.

Write to Devlin Barrett at devlin.barrett@wsj.com