I have read the text carefully, but seem to have missed where it says in 2 Samuel 5 that David had not been to Jerusalem before taking Zion. The Jebusites did say, “You shall not come in here…” (6), but that was in response to his approach to their city at that time. There is no reason to think they were saying that he’d never been there.
After killing Goliath, 1 Samuel 17:54 says David took the giant’s head to Jerusalem. No reason is given for taking it there, nor are we told where at Jerusalem it was placed. But, presumably David took it there because he lived in the area. His family was from the city of Bethlehem(1 Samuel 16:1, 18; 17:12, 58), which is just a few miles south of the city of Jerusalem . Of course, why he took the head of the giant there is not important. The text simply tells us that he did.
There is no discrepancy in the information supplied in the texts given by the questioner.
There is no contradiction.
A response to 1001 Bible Contradictions.