Nygren combined with fellow substitute James Forrest to put Celtic back in front midway through the second half with a deft finish.
The Swede faced a lengthy wait for a VAR check before he could celebrate, but Gavin Molloy's outstretched foot was ultimately judged to have played the midfielder on.
Kieran Tierney had followed up his goal in Sunday's 2-2 draw at arch-rivals Rangers with an early opener at Pittodrie.
Celtic had to come from 2-0 down at half-time to salvage that gritty result in the Old Firm derby.
Their careless defending reared its head again when Kevin Nisbet levelled for Aberdeen with a penalty.
But Nygren's 19th goal this season ensured Celtic wouldn't miss the chance to put pressure on Hearts.
Celtic's first win in three league games put them a point above second-placed Rangers and five behind Hearts.

Martin O'Neill's side return to Rangers on Sunday in the Scottish Cup quarter-finals.
