1 John 5:20 (LSB)
20 And we know that the Son of God has come, and has given us understanding so that we may know Him who is true; and we are in Him who is true, in His Son Jesus Christ. This is the true God and eternal life.
Jesus is called "the true God, and eternal life", because He is the nearest referent. Additionally, 1 John 1:2 says that the Son is "eternal life".
Many Trinitarians would readily acknowledge that this refers to the Father, who is the ultimate source of Eternal Life in 1 John (1 John 5:11). The antecedent is not the Son, but "Him that is true" (hence "the true God"), which the Father. It is simply a fact of language that often, the antecedent of a pronoun is not the closest noun.
For example, consider the following from the same writer:
2 John 1:7
7 For many deceivers are entered into the world, who confess not that Jesus Christ is come in the flesh. This is a deceiver and an antichrist.
Above, the phrase "this is a deceiver and an antichrist" obviously does not refer to Jesus, although He is the nearest noun. Instead, it refers to the "deceivers" mentioned earlier in the verse. Another example of this can be seen in Acts 10:38.
Additionally, Jesus explicitly says that the Father is "the only true God" (John 17:3), which indicates that the most consistent way to interpret the passage in question is that the Father is the "true God" being referred to.