WASHINGTON—House Speaker Nancy Pelosi is pushing to strip out sweeping legal protections for online content in the new trade pact with Mexico and Canada, in what would be a blow for big technology companies.

Internet firms lobbied hard to include the immunity language in the trade agreement, seeing it as a way to extend to Mexico and Canada the broad umbrella of legal protection they enjoy in the U.S.

But the trade-pact language also could make it harder for Congress to withdraw the current federal online protections for internet firms in the future, some lawmakers fear. That is causing second thoughts about including the legal shield—regarded by tech firms as a pillar of the internet—in a trade pact.

“There are concerns in the House about enshrining the increasingly controversial…liability shield in our trade agreements, particularly at a time when Congress is considering whether changes need to be made in U.S. law,” a spokesman for Mrs. Pelosi (D., Calif.) said.

The internet content dispute is one of several issues clouding passage of the U.S. Mexico Canada Agreement, or USMCA, that would replace the North American Free Trade Agreement.