The Devils played their third game in four nights. They beat the Anaheim Ducks and Los Angeles Kings in overtime before traveling to Northern California to face the Sharks.
"We played them pretty well but they got the two goals," Devils center Travis Zajac said. "We matched them after that and there were just a couple of plays we didn't execute, and couldn't get another one."
Hannan scored early in the first period from just inside the blue line. Hannan received a pass from Thornton, who has 43 points in 35 games against the Devils, his second most against any Eastern Conference opponent.
Thornton has 11 points in 10 games.
Kennedy scored late in the first period to make it 2-0 after Marty Havlat passed the puck out to him from behind the net.
"I don't know how he saw me, but Marty found me with a great pass," Kennedy said. "I couldn't ask for better linemates. All the credit goes to them."
Elias scored during a power play midway through the third period. Andy Greene slid the puck out to the right side, and Elias shot it past Niemi's right shoulder. Steve Bernier helped by screening Niemi.
The Devils, who came in averaging 25 shots a game, were held to 19 — including only 10 through two periods.
NOTES: Thornton moved into a tie with Nicklas Lidstrom for 50th place on the NHL career points list with 1,142. ... Elias has eight points in his last seven games against the Sharks. ... Devils RW Michael Ryder played in his 700th NHL game. ... Havlat recorded his first point in seven games.