Jay McClement made it 2-2 with a shorthanded goal at 6:24. After picking up a loose puck at the red line, he skated down the right wing before cutting to the net and shoveling a shot past Hammond at 6:24.
The Senators reclaimed the lead with a shorthanded goal in the final minute of the second period. Curtis Lazar's pass in the neutral zone set up Zack Smith, who raced around Noah Hanifin and beat Ward between the legs from the left circle at 19:25.
After fighting the puck a bit in the second period, Hammond (34 saves) settled in to make several good stops in the third period, including blocker saves on Brendan Woods and Ron Hainsey.
"It was a game of swings," Ottawa coach Dave Cameron said. "We were real good in the first, they were real good in the second. I thought we sat back a bit in the third, but certainly when you give up a goal with (0.2) seconds on the clock, it's a little disheartening."
The Senators had two looks at the empty net in overtime, but Stone and Mike Hoffman each missed wide of the net.
"We had a couple looks at the empty net, but full marks to them," Cameron said. "It's just a loss tonight."