Ilya Bryzgalov made 13 saves in the third period to fight off the Penguins. Philadelphia jumped past Pittsburgh into the lead in the Atlantic Division.
Hartnell's goal came with 6:28 to go in the middle stanza.
Bryzgalov stopped 25 shots overall and Marc-Andre Fleury made 26 saves for the Penguins, who have lost three out of five.
Pittsburgh played without team captain Sidney Crosby, who sat out the game as a precaution after colliding with teammate Chris Kunitz Monday in a loss to Boston. Crosby will also miss Saturday's meeting with the New York Islanders.
NBC reportedly holds celebs hostage to Jimmy Fallon's show
Ray Liotta sues skin care company over use of likeness