Niederreiter followed his centering pass and scored from low in the right to cut Detroit's lead to 2-1 at 13:54.
Gagner scored an empty-net goal with 55 seconds remaining for the 3-1 final.
"We were trying to be too cute, too fancy at our blue line and their blue line, and that backfires quickly," Niederreiter said. "They're a hard-working team and they definitely outworked us."
Bernier, whose name surfaced in trade rumors ahead of the NHL Trade Deadline on Monday, made a stick save on Vincent Trocheck's breakaway before stopping Warren Foegele's rebound shot with his right pad at 15:05.
"You look at Jonathan Bernier as example No. 1," Larkin said. "He was stressed, and he wants to be a Red Wing, and he showed it tonight. [It was] an incredible performance. He showed how professional he is no matter what he is facing. He was our rock tonight, and he is most nights he's in [goal]."
NOTES: Detroit traded forward Anthony Mantha to the Washington Capitals for forwards Jakub Vrana and Richard Panik and two draft picks. … Detroit forward Vladislav Namestnikov was scratched with an injury. … Erne has a seven-game point streak (five goals, two assists). … Defenseman Gustav Lindstrom had one hit in 10:52 in his season debut for the Red Wings. ... Trocheck's seven-game assist streak ended. He also had a point in 13 straight games in which he played (seven goals, 11 assists); he missed eight games with an upper-body injury.