Rafalski's slap shot 31 seconds into overtime came after Sabres' rookie Tyler Myers received a penalty for delaying the game with just over a minute remaining in the third period.
"I saw the defenseman go right... so I knew I would have a good chance to get a shot through and Nick (Lidstrom) slid it over to me," Rafalski told reporters.
With the victory secured the Red Wings turned their sights to their next game on Monday in Calgary against the Flames, who they lost to on Tuesday.
"Going into Calgary on Monday could decide playoffs, so we wanted to make sure we had the two (points) here," Rafalski said.
Pavel Dastyuk and Patrick Eaves had scored 73 seconds apart in the first period to give Detroit an early 2-0 lead before Buffalo's Jochen Hecht tied the scores in the second period after his second goal of the game.
"Just right at the start I thought they won more battles than us in the second period for about five minutes," Red Wings coach Mike Babcock said.
"Other than that I thought we were pretty good, and I thought, to tell you the truth, they were fortunate I really thought to get through the first period 2-1. We had a lot of pressure on them."
(Reporting by Mike Mouat in Windsor, Ontario; Editing by Greg Stutchbury and Patrick Johnston)