Deacs come away with a close win