I'm surprised this article didn't mention an earlier incident in the New Testament. While Jesus Christ was dying on the cross, He made several utterances, some to the crowd and some to God. One of His last utterances was "Father, into Thy hands I commend my spirit". It was at that point His spirit, or Holy Ghost, left His body. I've always associated the idiom "giving up the ghost" with that passage in the Bible.