Matthews gave Toronto a 2-1 lead at 12:36 when he put in a loose puck in the slot. Mitchell Marner played it toward the slot while falling along the goal line, and it went off Nylander's skate to Matthews.
"I think we just stayed patient throughout the whole game," Matthews said. "There wasn't much going on in the first two periods. We tried to stay patient and play as little in our zone as we could. It was a tight game, but we were able to get a couple of big goals in the third."
WATCH: [All Kings vs. Maple Leafs highlights]
Nylander scored 30 seconds later off a pass from Matthews on a 2-on-1 to make it 3-1 at 13:06. The assist was Matthews' 100th in the NHL.
"I was just looking to dish it back to Auston, and then I saw their defenseman stayed with him and that [goalie Jonathan] Quick was kind of set," Nylander said. "I was able to pull it to the middle, and [Quick] just kind of opened up."
Alex Kerfoot scored, and Frederik Andersen made 24 saves for the Maple Leafs (8-5-3), who have won two straight and are 3-1-1 in their past five games.
"Some people thought that was ugly, I thought it was beautiful," Toronto coach Mike Babcock said. "We need to go through that and figure out who we are, and the harder the game is, the better it is. Would you like to win by a touchdown and everyone relaxes? Sure, but we're not getting anywhere like that. This was important, give up one goal, play well without the puck, we had to grind. It was good for us."