Mayor Bill de Blasio on Tuesday announced that New York City had filed a lawsuit against the manufacturers and distributors of opioid prescription drugs, joining a national campaign to hold the companies responsible for hundreds of millions of dollars in costs related to the deadly opioid epidemic.

It was the second time this month — and the second time in his just-begun sophomore term — that Mr. de Blasio has held a news conference to herald legal action taken against corporate giants that he blames for problems that impact the city and beyond. On Jan. 10, he said the city was suing major oil companies, with the aim of collecting damages to cover the city’s costs in responding to climate change.

The lawsuits appeared to be a new favored tactic by Mr. de Blasio in his ongoing effort to take on issues with national scope, raising his profile outside New York City as he does so.

“It is a national tragedy,” Mr. de Blasio said of addiction to opioids. “It needs a national solution.” He spoke at a news conference at a community center in the Bronx where he was joined by a mother who said her son died of an overdose of opioids, and city officials charged with combating the worsening scourge of overdoses.