The Sharks made amends for a 6-0 loss at Dallas on Jan. 31.
"It was a huge game, because of how the last game went but more importantly because of where we are in the standings and what's ahead here on our schedule," Sharks coach Peter DeBoer said. "It's a critical two points."
Stars goaltender Ben Bishop made one save on five shots and was replaced by Kari Lehtonen at 17:23 of the first period after Boedker's second goal made it 4-0.
Gemel Smith and Tyler Pitlick scored in the third period for the Stars (34-21-4), who remained tied with the St. Louis Blues for third place in the Central Division.
"They scored every chance they got," Stars defenseman Dan Hamhuis said. "Our determination level was not high enough. You could see when it was there, we took over the game. The same things are showing up and we have to find ways to get over the hump. We've got to get our game back."
Pavelski gave San Jose a 1-0 lead 27 seconds into the game when he spun clockwise and elevated a backhand from the slot past Bishop.
Karlsson made it 2-0 at 5:59 when he jammed a loose puck inside the left post.
"We were actually moving this game," Braun said. "In Dallas, everyone left their legs somewhere else, so it was good."