The score was deadlocked 1-1 midway through the third when New Jersey's Dainius Zubrus was whistled for interference.
Steve Ott's shot during the ensuing power play was blocked by Cory Schneider but the rebound came to D'Agostini, who fired it home with 8:11 remaining.
Michael Ryder scored and Schneider finished with 20 stops for the Devils.
Ray Liotta sues skin care company over use of likeness
Boston schools pull out free condoms over wrapping complaints