Shut out by Chicago on Tuesday, Detroit's scoring drought reached 121 minutes, 35 seconds before Lidstrom broke through on the power play with 9:43 to go in the third period.
The Red Wings killed a power play that extended into overtime and got a pair of big saves from Legace before producing the game-winner.
Fedorov got a pass from Lidstrom at the top of the left faceoff circle and rifled a shot past Grahame's stick side and just inside the left goalpost for his ninth goal of the season.
"I came between our players, walked in, picked up the pass and shot it," Fedorov said. "There was pretty much nobody on me. It was sort of a half-slap shot. I guess the goalie was guessing I was going to go far side, but I like that shot short side."
"I tried to come out and close the one side," said Grahame, who missed the previous seven games with a shoulder injury. "I did that, and he blew it by me on the other side."
It was Fedorov's 11th career regular-season overtime tally, tying Chicago's Steve Thomas for the all-time record.
"It never occurred to me," Fedorov said. "Tonight, I got a little bit lucky."
Joe Thornton scored the lone goal for Boston but was taken down by Brendan Shanahan moments before Lidstrom scored the equalizer.
"We could have put them away, but we'll take the point," Thornton said.
As he did against Chicago on Tuesday, Legace came up big in the first period to keep the Red Wings in it. He stopped 14 shots and helped Detroit kill a pair of power plays.
"They came out flying and we got caught flat-footed," said Legace, who got the start in place of a flu-ridden Curtis Joseph. "We didn't want to give up anything early. They just kept coming and I made a couple of lucky saves. I was out of position and I just put my leg out and made one save."
The second period was a mirror image of the first as Grahame turned aside 14 shots and helped Boston survive five power plays, including a 54-second two-man advantage.
"Grahame was great and I loved the way our penalty-killing worked," Bruins coach Robbie Ftorek said. "It was a great game, but I'd like us to put our goals in when we have a chance. If we had put the pucks in early, it might have been a different game."
Thornton ended the goaltending duel 5:16 into the third period. Defenseman Mathieu Dandenault coughed up the puck in his own zone and Thornton made several dekes before beating Legace for his fifth goal.
Boston's Jozef Stumpel was penalized for high-sticking at the nine-minute mark and the Red Wings needed 77 seconds to convert their seventh power-play chance.
Lidstrom worked a give-and-go with rookie Henrik Zetterberg, getting a return pass at the edge of the left circle and putting a shot under Grahame's glove and inside the right post.
"I'd hate to see where we'd be if Nick wasn't here," Legace said. "The man is remarkable. He doesn't talk much in the room, but he doesn't have to. He just goes out and plays his best every game. He's scary."