Let's back up and look at the context of that verse, so that we can understand what Jesus meant.
John 5:
24 Verily, verily, I say unto you, He that heareth my word, and believeth on him that sent me, hath everlasting life, and shall not come into condemnation; but is passed from death unto life.
25 Verily, verily, I say unto you, The hour is coming, and now is, when the dead shall hear the voice of the Son of God: and they that hear shall live.
26 For as the Father hath life in himself; so hath he given to the Son to have life in himself;
27 And hath given him authority to execute judgment also, because he is the Son of man.
28 Marvel not at this: for the hour is coming, in the which all that are in the graves shall hear his voice,
29 And shall come forth; they that have done good, unto the resurrection of life; and they that have done evil, unto the resurrection of damnation.
So, how does Jesus teach that one passes "from death to life"? By behaving well enough? Or by hearing His word and believing? (Remember, faith comes by hearing and hearing by the word of God).
In context the "good" that is done is to hear the word of Christ and believe. The "evil" is, by contrast, is unbelief and rejecting the Son in whom life is found.
These verses do not speak of works.