DAVENPORT, Iowa—The unity between the Democratic primary’s two liberal firebrands, Sens. Bernie Sanders and Elizabeth Warren, is being tested as Iowa’s caucuses next month loom over the 2020 race.

Ms. Warren, who has lost ground in polling and fundraising in recent months, seems loath to directly needle the Vermont lawmaker on just about anything. But some of Ms. Warren’s allies say Mr. Sanders’s identity as a self-described Democratic socialist could be a vulnerability for him—and, by extension, for her, if more moderate voters cannot distinguish between them.

Ms. Warren has long said she believes in well-regulated markets and capitalism. But while she has declined to criticize Mr. Sanders and said earlier in the 2020 race that she was “with Bernie” on Medicare for All, she began subtly highlighting policy splits and ideological differences that separate herself and Mr. Sanders as the campaign heated up.

After he said during a Democratic debate last month that he would oppose the Trump administration’s newly negotiated trade deal with Mexico and Canada, calling it a bad deal for U.S. workers, Ms. Warren told a local Boston news outlet that the pact wasn’t perfect but would provide some relief from President Trump’s trade wars.

“It’s gonna help open up some markets for farmers. They need that stability,” the Massachusetts senator said last week, declining to explain why her position was better than Mr. Sanders’s and telling a reporter to “ask him.”