The grammar could apply either to {ekklesia} or to {theou zontos}. Contextual clues:
immediate context:
i1.) In immediate context, {theou zontos} immediately precedes “pillar and ground of truth”; the phrase would have to refer back through this to {ekklesia}. So placement, though not decisive, lends weight first to this phrase applying to “(of) (the) living God”.
i2.) Neither ‘congregation’ nor ‘living God’ uses direct articles; and the phrase doesn’t use direct articles primarily either, only secondarily in the possessive prepositional phrase “of the truth”. So comparative use of direct articles can’t help in any direction.
i3.) Keeping the qualification of (2) in mind, as well as the placement of (1), the phrase could be construed as a title for the living God.
i4.) See x2 below.
local context:
l1.) The “living God” is given a title (without direct articles) of “Savior of all men” not long afterward at 4:9. The constructive parallel isn’t entirely exact, since this verse contains a clarification “who is [title]”. But I’d say it still weighs in the direction of the former phrase being a title as well.
extended context:
x1.) It is God Himself Who is the ground of all truth elsewhere in scripture. This is related to God occasionally being euphamistically referred to as the Truth as well, such as in oath-swearing (of which there are several examples in the NT, including by Paul.)
x2.) For trinitarians (and maybe modalists, although they would have trouble with the distinction of the Persons otherwise testified to) this especially pertinent in the declaration by Jesus that He Himself is the Way, the Truth and the Life (John 14:6). Saint Paul elsewhere considers the ecclesia of God to be equally the ecclesia of Christ (Rom 16:16 for example–I don’t recall him calling the ecclesia that of Christ in 1 Tim, but in his salutation at 1:1 he declares himself “an apostle according to the injunction of God our Savior and the Lord Jesus Christ our Hope,” with the Father and the Son splitting a typical OT description of God as savior and hope.) Notably, 3:16 continues immediately afterward with a kerygmatic declaration of the greatness of Christ, the secret of devoutness, “Who was manifested in flesh, justified in spirit, seen by messengers, proclaimed among the nations, believed in the world, and taken up in glory”. If Christ is the “living God” to Whom the ecclesia (congregation, church) belongs, then topically it makes sense for Paul to jump from a title description of this living God (pillar and base of truth) to add a kerygmatic proclamation about Him.
Unitarians might (or might not, depending on the type) reply that from their perspective Jesus shows that a not-God creature could rightly without blasphemy describe himself as the Truth (and the Life and the Way, apparently but not really on a par with God though distinct in identity), so if Jesus could be described that way, the church might be described that way, too, without blasphemy.
Even if this is accepted as possible, though, the combination of immediate and extended contexts would still point more strongly to Jesus (that other not-God entity, elsewhere described as being the living God) being the “living God” to whom the church belongs and about whom it is being said that he (not his church) is the pillar and base of truth.
x3.) I haven’t yet been able to find another example in the NT of anyone or anything (including the ecclesia) being both correctly and clearly called something as strong as the ground and pillar of truth, other than God and/or Christ.
metaphysics
m1.) Calling anything by a phrase as strong as “the ground and pillar of truth” would be tantamount to putting it up on par with, or identified with, God Almighty. But the Church is clearly not the foundational source of all truth. We the Church receive truth from, and serve, the foundational source of all truth.
m2.) At best, saying that the church of the living God is the pillar and ground of truth, would be tantamount to saying that the church creates the truth of the living God, with God depending on the church for any truth about Him. This would be a metaphysic that God is only real and true because the Church invented or created Him.
Overall, then, all considerations I can think of or find so far, either are neutral on the question (but not many are), or else point with varying weight away from the notion that Paul was trying to call the church the pillar and ground/base of truth, and toward the notion that he was describing the living God that way (to Whom the church belongs).