Although the bill is seen as unlikely to become law in its current form — Senator Mitch McConnell, Republican of Kentucky and the majority leader, has come out against it, as has the Trump administration — the drug industry has fought hard against it. Its main lobbying group, the Pharmaceutical Research and Manufacturers of America, has called the bill “devastating,” and said it would lead to fewer new drugs coming to market.

Some of the bill’s biggest backers are labor groups, including the national A.F.L.-C.I.O., some of whose members are part of Pilma. A spokesman for the federation declined to comment beyond pointing a reporter to its position supporting Ms. Pelosi’s bill.

Other unions that support efforts to lower drug costs avoided criticizing labor groups, either declining to comment or choosing their words carefully. “National Nurses United is really focused on the real culprits behind these outrageous drug prices, which is the pharmaceutical industry specifically,” said Amirah Sequeira, the lead legislative advocate for the nurses union, which has not yet supported Ms. Pelosi’s bill because it believes it does not go far enough in lowering costs.

In addition to Facebook ads, Pilma also mailed fliers to voters in swing districts like Mr. Kim’s in New Jersey, a state where the pharmaceutical industry plays a major role in the economy. The mailing warned that Ms. Pelosi’s bill would jeopardize 54,000 jobs in the state and would “risk access to critical medicines.”

Mr. Kim’s office declined to comment.

Among Pilma’s members are unions that represent a range of building trades involved in manufacturing plants for pharmaceuticals, like sheet metal and iron workers, electrical workers, and plumbers and pipe-fitters. The International Union of Police Associations and the International Association of Fire Fighters are also members. According to Pilma, the pharmaceutical industry is responsible for 4.7 million jobs in the United States , including many highly skilled union jobs.

A spokesman for the International Association of Sheet Metal, Air, Rail and Transportation Workers, whose president, Joseph Sellers, Jr., is chair of Pilma, said that while the union supported expanding access to prescription drugs, it also relied on companies like drug makers to provide good-paying jobs. “Without jobs to fund them, there are no health care plans in the first place,” said the spokesman, Paul Pimentel.

One of Pilma’s members, the International Brotherhood of Boilermakers, has been outspoken about its struggle to contain high drug prices — one family covered by its health plan requires a drug that costs about $1.5 million a year per person.