Carolina snapped a two-game losing streak, avoiding its worst run since the defending Stanley Cup champions dropped their first four games of the season.
"Sometimes it takes a while to get the rust off," Grahame said. "We came off a couple of frustrating experiences and I think the guys buckled down."
The Hurricanes lost 4-2 at the New York Islanders on Wednesday despite Grahame's 44 saves. They were beaten 4-0 by the New York Rangers on Tuesday.
Patrice Bergeron scored a power-play goal for Boston, which lost for the second time in seven games. The Bruins' previous six games were decided by one goal.
Grahame stopped 25 shots for the Hurricanes. Boston starter Tim Thomas was pulled after Carolina's third goal.
"I thought he was our best player," Boston coach Dave Lewis said of Thomas. "I didn't want to subject him anymore to their approach. We had 19 players that were off their game and he was the only one that was on."
The Hurricanes outshot the Bruins 40-26.
Williams scored from the edge of the crease, converting Scott Walker's shot from the point at 10:35 of the second. Cole cut around defenseman Mark Stuart on the ensuing faceoff and slipped the puck between Thomas' pads. Philippe Sauve, recalled earlier in the day from Providence of the AHL, replaced Thomas.
The Hurricanes protected the win by playing smart defense.
"That was a big point in the game for us," Carolina defenseman Mike Commodore said. "I think with the new rules, you don't want to think you've got it (won). But you know you don't have to press."
Belanger and Ladd scored in the third period after Bergeron's goal cut the Bruins' deficit to 3-1.
Carolina grabbed a 1-0 lead when Staal's shot from the left circle caromed in off Stuart with 1:24 left in the opening period.
Each team missed a breakaway chance in the first 12 minutes. Thomas flashed his left pad to rob Niclas Wallin, and Bruins forward Marco Sturm shot wide when tried to put the puck over a sprawling Grahame.
Thomas nearly gave up an embarrassing goal early the second when he came out to the left boards and made a clearing pass to the Carolina blue line. Hurricanes center Chad LaRose grabbed the puck and fired it at the open net, forcing Thomas to hustle back and make a diving stop.
- Former Bruins general manager Mike O'Connell, fired after last season, was in the press box. He now scouts for the Los Angeles Kings.
- Linesmen Derek Amell was knocked over backward into the Carolina bench in the first period, forcing a stoppage in play.
- The game was the first half of a hockey-basketball doubleheader. The Boston Celtics were scheduled to face the New York Knicks on Friday night.