The best-of-7 series is tied 1-1. Game 3 is at Tampa Bay on Saturday.
It was Tavares' first hat trick in the Stanley Cup Playoffs.
"Any time you get a hat trick and especially one in the playoffs, it's pretty cool," Tavares said. "Obviously I got rewarded from some great plays from my teammates, starting with Morgan Rielly] who had a [heck] of a night. Any time you can contribute, find a way to get three, it's always positive to do that and just a sign of the group and how everyone is playing well together."
Rielly had four assists, Mitchell Marner had two goals an assist and Ilya Samsonov made 20 saves for the Maple Leafs, who are the No. 2 seed in the Atlantic Division.
Toronto lost 7-3 in Game 1 on Tuesday.
"It was a great response, couldn't ask for a better start," Maple Leafs coach Sheldon Keefe said. "To earn the power play to begin with and to shoot it in the net right away like that, I thought just our overall focus and execution I thought was really sharp tonight in that first period.
"We needed a response tonight in a big way, they took it to us pretty good the other night, and we needed to have a good day today and we did. So now we have a series. We'll get out on the road and have to play even better than we did tonight."
[RELATED: [Complete Maple Leafs vs. Lightning series coverage]
Ian Cole and Corey Perry scored, and Andrei Vasilevskiy made 30 saves for the Lightning, who were playing without defensemen Victor Hedman and Erik Cernak. Each was injured in Game 1.
"This had nothing to do with Victor Hedman being out of the game," Tampa Bay coach Jon Cooper said. "We've won games in this league without Victor Hedman. I could sit here and go through 100 years of clichés, which one do you want? In the end, did we play hard enough to win? Probably not. … It's not because one guy was out, that would be just a poor, poor excuse."