The prepositional phrase ὑπὸ τοῦ θεου (hypo tou theou) immediately follows ἀδελφοὶ ἠγαπημένοι (adelphoi ēgapēmenoi), and so the most natural reading (and that followed by virtually all modern translations) is "brothers beloved by God" (in fact I am not aware of any translations outside of the N/KJV that translate it any other way). "The election" is followed by a genitive possessive pronoun (τὴν ἐκλογὴν ὑμῶν, tēn eklogēn hymōn), i.e. "the election of you", best translated simply as "your election". The KJV (and NKJV, which is merely an attempt to modernize the English used in the KJV) likely translated the passage the way they did in order to emphasize that "your election" is of God (the 1611 edition of the KJV even has a footnote in the margin indicating the "alternate" reading1), but this is not how the Greek actually reads. The Greek text itself simply says, "your election".
With that said, election is always "God's choice" in Pauline writings:
“The election of you,” that is, “that you have been chosen,” namely, by God, as always in Paul. The eternal choice of God, “the divine purpose which has worked on the principle of selection”..., includes, according to II [Thessalonians] 2:14, not only the salvation of the readers but also the means by which or the state in which salvation is realized.
The words ἐκλέγεσθα (1 Cor. 1:27 ff. Eph. 1:4), ἐκλεκτό (Rom. 16:33) [sic], ἐκλεκτοὶ θεου (Rom. 8:33, Col. 3:12), and ἐκλογη (Rom. 9:11, 11:5, 7, 28) are rare in Paul. ἐκλογη does not occur in the LXX.... κλῆσι (II [Thessalonians] 1:11), καλεῖ (2:12, 4:7, 5:24) is the historical calling mediated by the preaching of the gospel (II [Thessalonians] 2:14).2
Because of this, many modern translators clarify whose 'choice' ('election') it is, such as the ESV, NRSV, NIV, NET, and NASB (as shown in the question, but note that "His" is italicized in the NASB translation to indicate that this is not in the original Greek text).
The main difficulty in translating this passage has nothing to do with the prepositional phrase, but rather the adverbial (or circumstantial) participle εἰδότες (eidotes), which most of the cited translations have elected (pun intended) to simply render as "Knowing, ...", which is a perfectly acceptable translation. Adverbial participles are subordinate to their controlling verb.3 The adverbial participle occurs here in a long introductory clause wherein it modifies Εὐχαριστοῦμεν (Eucharistoumen), i.e. "We give thanks...." This entire clause (vv. 2-5) could be outlined as follows:
We give thanks to God always for all of you,
making mention of you in our prayers,
constantly bearing in mind
your work of faith
and labor of love
and endurance of hope
in our Lord Jesus Christ
in the presence of our God and Father,
brothers beloved by God,
because our gospel did not come to you
in word only,
but also in power
and in the Holy Spirit
and with full conviction,
just as you know
what sort of people we proved to be
for your sakes.
This entire clause is one sentence in the original Greek text (and arguably continues beyond v. 5). Due to the length and complexity of this sentence, some English translators opt to translate the participle (εἰδότες, eidotes) as a finite verb instead ("For we know, ..."), such as the NRSV and ESV.
"Knowing" (εἰδότες, eidotes) modifies "we give thanks" (Εὐχαριστοῦμεν, Eucharistoumen), telling the reader why thanks is given: the election of Paul's readers. Paul goes on to explain his confidence in his readers' election: "because" (ὅτι, hoti) the gospel he proclaimed came to his readers "in power and in the Holy Spirit and with full conviction" (and Paul continues this line of thought in v. 6).
1 The KJV 1611 footnote reads, "Or, beloved of God, your election".
2 James Everett Frame, A Critical and Exegetical Commentary on the Epistles of St. Paul to the Thessalonians, International Critical Commentary (New York: C. Scribner’s Sons, 1912), 78. Available for free on archive.org.
3 "The adverbial or circumstantial participle is grammatically subordinated to its controlling verb (usually the main verb of the clause). Like an ordinary adverb, the participle modifies the verb, answering the question, When? (temporal), How? (means, manner), Why? (purpose, cause), etc."
Daniel B. Wallace, Greek Grammar Beyond the Basics - Exegetical Syntax of the New Testament (Zondervan Publishing House and Galaxie Software, 1996), 622.