Pens edge Leafs in dying seconds