"We were able to contain them after they had the two goals and came right at us and skated circles around us," Ribeiro said. "Andrew made some big saves at the right time, and our special teams were good enough to get us the win."
Derek Joslin scored his first NHL goal, and Clowe also found the back of the net for the Sharks, who lost for the second time in five games. Clowe has points in five straight games and seven of eight.
Raycroft, in his fourth straight start in place of the injured Kari Lehtonen, stopped 31 shots -- including a series of point-blank saves that got the game into overtime.
"They got a couple of fluky goals, to be honest," Raycroft said. "The first one I got my leg kicked out completely and was unable to get into the play. The second one went off a jersey or something. We didn't give them much at all and kept plugging away."
Antti Niemi made 29 saves for the Sharks, who begin a three-game road trip at Nashville on Wednesday night.
"It was a good divisional game," San Jose captain Joe Thornton said. "There was a lot of passion in that game. It was a real solid game. You'd like those types of games to continue and just play forever. It was just too bad we lost in a shootout."
Dallas captain Brenden Morrow took a puck to the face near the end of the first period but returned to the ice with a special mask to protect his lip and nose, where he was struck.
Ribeiro beat Sharks defenseman Marc-Edouard Vlasic to the puck behind the net and set up a wide-open shot for Benn from the slot as the Stars took the early lead with 13:43 left in the first period.
The Sharks, outworked for 25 minutes, then scored twice within two minutes of the second period to take a 2-1 lead.
"I'd like to have the first 10-12 minutes back again," San Jose coach Todd McLellan said. "I think it was pretty evident we didn't have a lot of jump or fight in us early. But we found it, and once we did, we were very competitive against a very competitive hockey club. It was a well-played game by both teams."
Joslin scored from the side after taking a sharp pass from Joe Thornton. Clowe followed with his fifth goal in eight games with an assist from Benn Ferriero.
"We wanted that win so bad," Joslin said. "We've just got to look forward to this road trip coming up."
The Stars tied it when Ribeiro scored off a pass from Stephane Robidas. Ribeiro has scored three of his five goals against the Sharks.
Material from wire services and team media was used in this report.