Lovejoy, 35, has two goals and five assists in 51 games in 2018-19 and was second on the Devils with 77 blocked shots while playing a key penalty-killing role. The 11-year veteran was traded back and forth between the Pittsburgh Penguins and Anaheim Ducks over the past decade before signing a three-year contract with the Devils in 2016 that expires after this season.
"Ben is a top-end penalty-killing defenseman, and he brings a good mix of both physicality and mobility to our back end," Stars general manager Jim Nill said. "Getting an experienced, battle-tested player who has a track record of performing in meaningful late-season games is important for our group, and we feel that he will help balance our blue line."
A defensive specialist, Lovejoy won a Stanley Cup with the Penguins in 2016. He has 20 goals and 99 points in 524 career games.
With Marc Methot out after season-ending knee surgery last month and Stephen Johns (neck/head) having not played this season, Lovejoy is a boost to the Dallas defense. The Stars reacquired defenseman Jamie Oleksiak from the Penguins in a trade last month.
In December 2017, Lovejoy became the first active NHL player to announce he was donating his brain to concussion research.
The Devils received defenseman Connor Carrick and a third-round pick in the 2019 draft in the swap.
Carrick, 24, had one goal and three assists in 14 games with the Stars. He joined Dallas in October when he was traded by the Toronto Maple Leafs after three seasons.
The trade comes with Dallas seeking to keep pace in the congested Western Conference playoff race in which five points separate the seventh-place Stars and 12th-place Canucks.
Dallas is 2-4-1 in its past seven games and hosts Carolina on Saturday.
The Associated Press contributed to this report.