Alfredsson got his second assist on Zack Smith's goal with 3:26 left that made it 3-1. He scored into an empty net with 53 seconds to go.
Kyle Turris had a goal and an assist, and Jason Spezza also scored for the Senators, who won in regulation for the first time during their current streak.
"We did play well in the third until they got their goal, but then all of a sudden it's a one-goal game," Alfredsson said. "I was able to get on a loose puck there and feed Smitty, who fires a great shot and kind of seals the game for us. Overall, we've got to be happy. We're doing it a lot of different ways, which is also encouraging."
Earlier in the day, Alfredsson and Spezza were among four Senators players elected by fans to the All-Star Game on Jan. 29 in Ottawa. Defenseman Erik Karlsson led all vote-getters, and forward Milan Michalek also was chosen.
"It's a big honor -- congratulations to those guys -- but they put that aside and came to work tonight," Anderson said. "They came out here and were four of our best players on the ice. They're great players and when they can park aside the individual rewards and put together a good team effort, that shows a lot about their character."
Steven Stamkos scored his NHL-leading 28th goal 8:48 into the third to draw Tampa Bay within 2-1. Stamkos, who has scored eight times during a five-game goal streak, ruined Anderson's bid for the Senators' first shutout of the season.
"They were buzzing pretty good and they got that goal to get them close and they made a big push but we didn't break," Anderson said. "We bent a little bit but we didn't break. We found a way to be poised with the puck and go down there and make it two goals again."
Dwayne Roloson stopped 20 shots for the Lightning, who lost 7-3 in Toronto on Tuesday night to end a three-game winning streak. Tampa Bay wraps up its three-game trip to Canada on Saturday night in Montreal.
"This time of the year, it's playoffs for us," said Lightning captain Vincent Lecavalier, who set up Stamkos' goal. "We can't slide down more. You know, a playoff game, you lose one -- yeah, it's tough, but you've got to bounce back and come out the same way against Montreal. We played 60 good minutes, a solid game, and we'll go from there."
Spezza, Alfredsson, Karlsson and Michalek were among the first six players voted to the All-Star game when fan balloting results were announced earlier in the day.
Tampa Bay's Martin St. Louis rang a shot that rattled off the posts but stayed out early in the third as he failed to record a point for the first time in his last eight games, including six in a row since returning from facial and nasal fractures.
St. Louis had scored a goal in each of his previous two games when he was hit by a shot in practice on Dec. 8. He missed the next five games, ending his consecutive games streak at 499.
Spezza, who will make his second All-Star game appearance later this month at Scotiabank Place, opened the scoring 10:36 in. The Ottawa center used his long reach to float a backhand of Colin Greening's rebound past Roloson.
Alfredsson drew an assist as Turris made it 2-0 with 2:53 left in the second. It was his first goal in 14 games, including eight for the Senators since he was acquired in a Dec. 17 trade with Phoenix.
Greening drove a shot off the post at the other end of the ice immediately after St. Louis' scoring chance.
Erik Condra had an apparent goal waved off at 18:58 of the first. Referee Kevin Pollock signaled a boarding penalty on Turris for his hit on Lightning defenseman Matt Gilroy behind the net while Condra began to celebrate after stuffing the puck inside the right post.
St. Louis had a goal and eight assists during his six-game points streak. ... Senators D Sergei Gonchar returned after missing two games. He was knocked out of the lineup Saturday in Buffalo after he was hit by a puck and cut on his helmetless head while skating during pregame warmups. ... Ottawa's Matt Carkner got the better of his fight with Lightning RW Adam Hall behind the Senators' net 12 minutes into the first.
Copyright by STATS LLC and The Associated Press
OTTAWA, CANADA - JANUARY 5: Craig Anderson #41 of the Ottawa Senators throws his stick to assistant equipment...