Marcus Pettersson and Bryan Rust scored, and Tristan Jarry made 33 saves for the Penguins (30-29-9), who are 2-5-1 in their past eight games.
Pittsburgh is 0-6-1 against New Jersey dating to Feb. 24, 2022.
"Whatever the highest level of desperation is, that's where we're at," Penguins captain Sidney Crosby said. "I think that's the situation we're in and there's nothing else to do other than play with some urgency and desperation and try to get a game at a time."
Mercer gave the Devils a 1-0 lead at 5:35 of the first period, getting a pass at the blue line and skating down the middle before Pittsburgh defenseman Ryan Graves inadvertently swept the puck off his stick and into his own net.
"Yeah (he swept it in), but we'll keep that on the low ... it still counts," Mercer said. "I just wanted to try to take it to the net as quick as I could."
Allen, who was making back-to-back starts for the first time since Oct. 21-23 with the Canadiens, made 12 saves in the first, including diving to his right to deny an uncovered Crosby at 18:38.
"I saw him ... he walked out in front of the net and was patient, waiting me out," Allen said. "It's desperation, but at the same time there's a lot of luck involved there and sometimes you're lucky, sometimes you're not. It was an important first game of this three-game homestand."
Pettersson tied it 1-1 at 7:16 of the second period on a slap shot from the point.
“The start was disappointing,” Penguins coach Mike Sullivan said. “They come out with a lot of pace, we didn't match the urgency. I thought we grabbed a hold of it after the first, but the first bit of the first period, they certainly had momentum early on.”