There is no implication that parties are considered within the amendment. Parties are not in the constitution at all.
The election of 1824 had this happen. John Quincey Adams (3d place finisher) was selected over Jackson and Clay in the famous “corrupt bargain”.
We have Roger Sherman to thank for that provision of the Constitution.