"It's been a long time since I've done that," Ryan said of his first three-goal game in the NHL since Dec. 29, 2014. "I don't know what I was expecting tonight. I was just kind of hoping to take a step forward within my individual game."
It was Ryan's second game, first in Ottawa, since returning from the NHL/NHLPA player assistance program.
"I knew, Ottawa being the community that it is, the reception would be good," he said. "It just got harder to kind of keep the emotions down throughout the game. It was incredible. They supported me and, I guess, to contribute, you can't write that, right? The way that went, it was just an incredible evening. Thank you to all of them."
[WATCH: All Canucks vs. Senators highlights]
Chris Tierney had three assists, and Rudolfs Balcers scored his first goal of the season for the Senators (22-31-12), who lost their previous four games (0-3-1).
Tyler Toffoli scored for the third consecutive game for the Canucks (34-23-6), who lost for the first time in three games and are 4-2-1 in their past seven.
"It [stinks]," Toffoli said. "It's unfortunate. We had a really, really good opportunity, and not what we wanted to do."
Video: VAN@OTT: Balcers scores 14 seconds into 3rd
Vancouver is tied with the Edmonton Oilers for second place in the Pacific Division, four points behind the Vegas Golden Knights.
"It doesn't matter what team we're playing," Canucks forward J.T. Miller said. "Playing on the road, 20 games to go, need two points. … Too many Grade A (chances) to give up. Against an NHL team, they're going to make you pay, no matter what."
Marcus Hogberg made 32 saves for his first victory in four starts (1-2-1).
"He's been great. He's been getting better and better," Ottawa forward Connor Brown said. "He's been competing for us when he's in there. You can't ask for much more."
Brown scored with a wrist shot from the right face-off dot to give the Senators a 1-0 lead at 7:13 of the first period.
Ryan redirected a pass from Nikita Zaitsev to make it 2-0 at 7:44.
"It was kind of a weird game," Vancouver coach Travis Green said. "I felt like we came out and we were better to start the game tonight, yet we were down 2-0. So now you're chasing the game."
Miller scored with a slap shot from the point on the power play to cut it to 2-1 with 16 seconds left in the second period.
Balcers scored 14 seconds into the third period off the rebound of a Tierney shot from the side of the net to make it 3-1. It was his first NHL goal since March 26, 2019, ending a 13-game drought.
Toffoli tipped Miller's one-timer from the point to make it 3-2 at 8:16. He has scored four times in the three-game goal streak.
Ryan took a pass from Tierney in his skates, kicked it to his stick, and scored with a snap shot to make it 4-2 at 17:52.
Ryan finished the hat trick when he scored into an empty net for the 5-2 final at 18:11.
"We have  games left," Ryan said. "I just want to finish the year as strong as I can and contribute and kind of help these guys close it out the right way."
Video: Enterprise Hat Trick: Ryan tallies three vs. Canucks
They said it
"You don't ever like to lose or see other players score on you, but it was obvious by the reaction of the crowd, there's still that human element in the game that you feel when guys go through tough things or battle through things. It was just good to see him back out there playing." -- Canucks coach Travis Green on Senators forward Bobby Ryan
"You don't know what it's like in someone else's life, in their mind, and what they go through. And obviously, his (situation) being so public, it's great to see people get behind him. And then for him to come out and show off his skillset like that was outstanding." -- Senators coach D.J. Smith on Bobby Ryan's hat trick in his second game since returning from the player assistance program
Video: Discussing Ryan's hat trick in Senators return
Need to know
Canucks defenseman Quinn Hughes had an assist on Miller's goal to extend his point streak to five games (seven assists). It was his 43rd assist, passing defenseman Dale Tallon (1970-71) for most in a season by a Vancouver rookie. ... Senators defenseman Thomas Chabot was a game-high plus-4.
Canucks: At the Toronto Maple Leafs on Saturday (7 p.m. ET; NHLN, CBC, SN360, SNO, SNW, SNP, NHL.TV)
Senators: Host the Detroit Red Wings on Saturday (7 p.m. ET; SN1, TVAS2, FS-D, NHL.TV)
Video: Ryan's hat trick helps Senators top Canucks