The Psalm had a prophetic element to be sure. That doesn't mean that the authors, who wrote, ca. 1000 B.C., understood what that prophecy was about. The only aspect of that Psalm that they would have understood would have been its immediate context--that it spoke of David. That is the context of the Psalm--that David was the firstborn of his family. From there we ascertain the definition of "firstborn," not from inference outside of the context. 
David was the firstborn because he was the most important or had the pre-eminence in his family. That is the meaning of the verse in the context in which it is written. It can have no other meaning in that psalm. Case closed.
		
		
	 
David in OT often meant Mashiach( Messiah) as you can read:
Isaiah 9:7
Of the increase of his government and peace there shall be no end, upon the throne of David, and upon his kingdom, to order it, and to establish it with judgment and with justice from henceforth even for ever. The zeal of the LORD of hosts will perform this
Jeremiah 29:16
Know that thus saith the LORD of the king that sitteth upon the throne of David, and of all the people that dwelleth in this city, and of your brethren that are not gone forth with you into captivity;
Jeremiah 30:9
But they shall serve the LORD their God, and David their king, whom I will raise up unto them.
Ezekiel 37:25
And they shall dwell in the land that I have given unto Jacob my servant, wherein your fathers have dwelt; and they shall dwell therein, even they, and their children, and their children's children for ever: and my servant 
David shall be their prince for ever
( Is this David the son of Jesse?)
You are saying that Bible tells David is the Firstborn of the family
but Psalm 89:27 is this
Also I will make him my firstborn, higher than the kings of the earth.
Bible says David is the Firstborn of the Kings of the Earth, not of the family!
Do you see the difference?