WASHINGTON — Justin Williams scored the overtime winner as the Washington Capitals beat the Toronto Maple Leafs 2-1 Friday night to take a 3-2 lead in their first-round series.

The Capitals survived a scare when captain Alex Ovechkin left the game late in the first period with an apparent left leg injury but returned in the second period. Thanks to Williams’ goal 1:04 into overtime, the Presidents’ Trophy winners go to Toronto for Game 6 on Sunday with a chance to advance to the second round, where they’d face the defending Stanley Cup champion Pittsburgh Penguins.

Braden Holtby made 24 saves for the Capitals, who got a goal from T.J. Oshie on the power play that came from Nazem Kadri’s hit that injured Ovechkin.

Rookie of the year finalist Auston Matthews scored the only goal for the Maple Leafs, and Frederik Andersen made 26 saves.

Williams’ goal was his third of the series. It’s also the 16th of his career in 43 tries in Games 5-7 as his team improved to 26-18 in those situations.

Four of the first five games of the series have been decided in overtime. What looked like a lopsided matchup going in has been as tight as anyone could have possibly imagined, with the teams separated by one goal in the series and tied in shots.

As if this tense series didn’t provide enough drama, the Ovechkin injury silenced the Verizon Center crowd. Ovechkin clutched his left knee, was down on the ice for several minutes and didn’t put weight on his left leg as he was helped off.

Kadri was given a penalty for tripping on the borderline low-bridge hit, and Oshie scored on a rebound on the power play 43 seconds later to put Washington up 1-0. Oshie has points in each game this series.

The crowd roared when Ovechkin stepped onto the ice for the start of the second period, and the 31-year-old captain crushed Maple Leafs defenseman Jake Gardiner into the boards on his first shift back. Ovechkin took six shifts and played five minutes in the second, in large part because of penalties.

The sense of relief that filled Verizon Center with Ovechkin’s return only lasted until the 6-minute mark, when Matthews put in a rebound for his third goal of the series to tie the score at 1. Toronto’s power play failed to cash in on several chances later that period and into the third.