The answer to this depends both on what is meant by "we" (I'll assume you're coming from a European perspective) and the particular time period in question. The name Africa comes from the Roman designation for an area corresponding to modern-day Tunisia and eventually was expanded to accommodate all of the confident, or at least those parts known to the Romans. The Romans and other ancient Mediterranean peoples certainly had extensive contact with societies on the North African coast, but even a very long time before them, Ancient Egypt, part of the Fertile Crescent, would have had contact with contemporary societies in Anatolia and Mesopotamia, as well as those to its south in modern-day Sudan.
Phoenicians later established Carthage, a network of predominantly-mercantile city states in Africa, Mediterranean islands, and the Iberian Peninsula that was centered in modern-day Tunisia. Both Greeks and Romans came into contact with Carthage early on and through their own trade and negotiations would have been aware of Africa in this way.
In terms of where native Africans fall in all of this, the Carthaginians dealt with indigenous Berbers often, at times in war and at times allying with them or making them clients. Further east, the Ptolemaic Kingdom occupied modern-day Egypt, and while it was governed by Greeks, the majority of its population would have been native Egyptian. On the Upper Nile, in modern-day Sudan, there existed a series of native African kingdoms in their own right. Aside from the individual African tribes which came and went, like the Blemmyes on the Red Sea or the Ethiopians to their south, more sedentary states like the Kingdom of Kush and Aksum went long-established and were important in regional trade for centuries, particularly for their iron.
Upon the ascension of Rome and the fall of Carthage, North Africa was occupied by Romans. Native Berber kingdoms such as Mauretania came under clientship of Rome, while in Egypt it is known that the Romans (and later the Byzantines) maintained contact with African kingdoms on the Upper Nile, such as Nobatia and Aksum, which both eventually converted to Christianity as a result of Roman influence.
This could go on for quite some time, but suffice it to say that during antiquity, Africa, at least its Mediterranean coast, the Nile, and its Red Sea coast, was fairly well-connected with the rest of the ancient world.
The nature of the question changes after the Arab invasions in the 7th century and the subsequent Arabization and Islamization of many of the parts of Africa already discussed. Not only is the Western understanding of Africa obfuscated by the arrival of Islam, which introduced a degree of religious contention, but it was made significantly more difficult for Westerners to access parts of Africa previously accessible as a result of Arab political control. Thus it is that for most of the Middle Ages, Africa became a decidedly-Islamic domain and any information about its interior during that time is likely to come from Muslim sources. It is also during this time that Islam, through trans-Saharan trade, is spread through the Horn of Africa and down into Mali.
From Ibn Battuta's account of his travels, we see that Muslim knowledge of a sizable portion of Africa was fairly extensive. Ibn Battuta traveled as far south as Tanzania on Africa's east coast and Mali on its west. In both places were fairly developed societies which Ibn Battuta was able to navigate more or less with ease, indicating a well-established and informative relationship between the native Africans in those places and foreign Muslims, in both cases mostly Arabs.
It wasn't until the beginning of European colonialism and the trans-atlantic slave trade that Europe would again become as familiar with Africa, and particularly it's sub-Saharan portion, as they had been in antiquity. Even then, however, direct European influence on the African continent was largely limited to individual colonies on its coasts; it was not until the 1800s and the Scramble for Africa that its interior would be ventured into in depth. This process continued even into the 1900s, but as that is outside the scope of your question, suffice it to say that for much of the Middle Ages, Africa, beyond its Arabicized north, was something of a mystery to Europeans.