The discovery was made during work to extend the castle's main shop and ticket office.
Historic Scotland said the find would help establish exactly where the defences stood.
European experts are believed to have been used to apply the latest Italian military engineering techniques at the castle in the 1540s.
They were brought in by Mary of Guise, widow of James V, at a time when intermittent warfare with England made it essential to have fortifications that could protect against heavy artillery in a siege.
The defences are shown in a 17th Century engraving by John Slezer.
Gordon Ewart, of Kirkdale Archaeology - whose team discovered the walling - said: "We knew the defences would have been in this area, but not exactly where because the Slezer engraving, and remaining military plans, are not entirely accurate.
"This is what makes the discovery of physical evidence so important - it helps us identify exactly what existed - and to understand more about what the castle was like in the past."
Much was changed at the castle between 1711-14 when the old defences were demolished during a programme of modernisation.
Further alterations took place when the esplanade was created in the early 19th Century.
Peter Yeoman, from Historic Scotland, said the discovery gave a "tantalising glimpse" of the fortifications created for Mary of Guise and paid for by the French king Henri II.
Mr Yeoman said they were probably designed by the Italian engineer Signor Ubaldini, who was working on a similar defensive spur at the time at Edinburgh Castle.
He added: "They are of great interest because they were early examples of a changing approach to military engineering, and among the most advanced in the whole of the British isles."

However, the resolution is non-binding, with Nigeria and Senegal opposing a withdrawal.
South Africa and Burundi have already decided to withdraw, accusing the ICC of undermining their sovereignty and unfairly targeting Africans.
The ICC denies the allegation, insisting it is pursuing justice for victims of war crimes in Africa.
The AU took the decision on Tuesday following a divisive debate at its annual heads of state of summit in Addis Ababa.
Part of the resolution also said the AU would hold talks with the UN Security Council to push for the ICC to be reformed.
After being discussed in several previous summits, this was a huge announcement showing how frustrated the AU was with the international court. But the debate itself showed how divisive the whole issue is.
The resolution isn't as strong as many who are opposed to the court would have liked. It only calls on countries to consider how to implement the decision but does not bind them to it. It's a victory for human rights activists who insist the court still has a very important role to play in the continent where many countries have weak judicial systems.
The resolution also calls for African countries to continue pushing for reforms of the court - another clear indication that ditching the court en masse isn't such a popular decision. The likes of South Africa and Kenya, which have pushed for withdrawing, will be disappointed that the discussions about completely severing ties with the ICC will have to wait another six months for the next summit.
Sudan's President Omar al-Bashir, who is wanted by the court on charges of genocide in Darfur, was at the summit.
In 2015, a South African court criticised President Jacob Zuma's government for failing to arrest Mr Bashir when he attended an AU meeting in the main city, Johannesburg.
The government later announced that it was withdrawing from the ICC because it did not want to execute arrest warrants which would lead to "regime change".
A total of 34 African states are signatories to the Rome Statute, which set up the ICC.
The ICC and global justice:
What does the ICC do?
Archaeologists have found fragments of Stirling Castle's 16th Century outer defences.
[NEXT_CONCEPT]
The African Union has called for the mass withdrawal of member states from the International Criminal Court (ICC).