It wasn't the prettiest effort for the Toronto Maple Leafs. Against the struggling Dallas Stars, it was more than enough.

The Leafs played a turnover, mistake and penalty-filled game, but their offense kept clicking in a 5-3 victory on Tuesday night. Toronto won for the fourth time in the past five games and has picked up nine out of a possible 10 points in that period.

"I think we're just a pretty confident group in here," said Tyler Bozak, who scored his 12th goal 27 seconds in. "Every line's producing, every player's stepping up and playing well and we're getting full team efforts most of the nights."

In addition to Bozak's quick strike, Joffrey Lupul scored twice and Phil Kessel ended his goal drought at five games. Nazem Kadri also scored for the Leafs (13-8-3), who haven't lost at home since getting thrashed by the Nashville Predators on Nov. 18.

Since back-to-back losses to the Buffalo Sabres and Predators by a combined 15-4, Toronto has outscored opponents 23-12.

"We still got plenty to work on," Lupul said. "Obviously things are headed in the right direction, but we know what can happen if you get complacent."

The Leafs did get complacent at times, and that led to goals by Jason Spezza, Ryan Garbutt and Ales Hemsky. Coach Randy Carlyle wasn't thrilled with the defensive performance, but he also wasn't eager to poke holes in a two-goal victory.

"We're going to take the two points, but we can't be happy with the sloppiness with which we played," Carlyle said "We cannot continue to play that style of game and think we're going to have success."

The Stars (9-11-5) know that all too well. Predicted to be among the big boys in the Western Conference, they've been unable to find consistency. That continued in Toronto, where turnovers led to a third straight loss.

"It's just not playing the right way," captain Jamie Benn said. "We've got to get it in our heads that it's got to go straight up the ice, it's got to be direct. That's the way we're going to win hockey games."

The Leafs will take winning hockey games any way possible, especially at Air Canada Centre. They jumped to a 3-0 lead and never led by fewer than two goals the rest of the way.

"We were definitely having to play catch-up all night," Stars winger Erik Cole said. "It's hard enough to win games without spotting them two and three-goal leads."

Jonathan Bernier, who stopped 35 shots, said it was the Leafs' worst game in their recent stretch.

"When you score that many goals, it's hard mentally to stay sharp and play defensively," Bernier said. "But we got the two points, and that's what matters."

Bozak's goal temporarily gave him the team lead, but then Kessel scored on the power play for his first since Nov. 15 in Buffalo.

"He's going to get his goals," Bozak said of Kessel. "I'm sure he's been not happy with the way it's been going for him lately. I'm sure he's going to start streaking here pretty soon and put a pile of them in there."

The Stars' Kari Lehtonen gave up five goals on 40 shots in the loss.

Lupul's goals gave him three in three games since returning from a broken bone in his right hand. With him producing, the Leafs have better offensive balance.

"I think the first couple games he was trying to do too much and playing as an individual, lots of turnovers," Carlyle said of Lupul. "I think in some situations he's got to get away from being that individual and let the puck do the work. But it's not because of lack of effort, that's for sure. He's out there trying and you can see his commitment."

NOTES: Toronto's Leo Komarov missed the game three days after taking a hit to the head. The gritty forward did not practice Monday or Tuesday, but Carlyle said Komarov's symptoms had subsided and he didn't believe his absence to be a long-term one. ... Stars winger Patrick Eaves left the game in pain during the second period after blocking a shot. He did not return. ... The Leafs went 5 for 5 on the penalty kill, including 1:30 of a two-man Stars power play in the third period.