In the beginning God created the heaven and the earth.
 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.  And God said, Let there be light: and there was light.
 And God saw the light, that it was good: and God divided the light from the darkness.
 And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
 And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years:
 And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so.
 And God made two great lights; the greater light to rule the day, and the lesser light to rule the night: he made the stars also.
 And God set them in the firmament of the heaven to give light upon the earth,
 And to rule over the day and over the night, and to divide the light from the darkness: and God saw that it was good.
 And the evening and the morning were the fourth day.
I’ve seen this topic danced around, with no particularly plausible explanation offered for the three cycles of daylight and darkness (day and night) transpiring before the appearance of the sun. For us today, who have grown up learning modern cosmology from an early age, the first explanation we hear of day and night is that it’s the result of the rotation of a spherical world; the side exposed to the sun experiencing daylight, while the opposite side falls in the sphere’s own shadow, or night. That explanation hasn't always been available to everybody.
Left to their own powers of observation, how might a primitive people perceive the cycles of darkness and light? We can try forgetting about the knowledge we possess today and make some "primitive" observations of our own.
Anyone who is up before sunrise knows that the sky is already light by the time the sun appears on the horizon. Likewise, in the evening the sky remains light for a while after the sun drops below the horizon. Furthermore, entire days may pass without the sun being visible at all from the ground when the sky is cloudy or overcast, or in the presence of fog, for example. Granted, the day is not as bright without direct sunlight, but there’s still plenty of light. Inside a hut or tent or the entrance of a cave we may also be cut off from direct sunlight, but the interior can still have plenty of light, depending on the nature of any openings to the outside. Similarly, at night there are differing degrees of illumination, depending on the phase of the moon, or whether it is visible in the sky at all. The sun will cast shadows, but so does the moon. A full moon seems very bright in the night sky, yet it is night nevertheless. Often the moon is visible in the daytime along with the sun, although not nearly as bright.
So, without knowledge of the real cosmological relationship between the sun and Earth, our observations might tell us that the sun merely accompanies day, without causing it, reasoning as follows:
- It can be daytime without the sun being visible in the sky. This can result from cloudy, foggy, or overcast conditions, or with the sun obstructed from sight by a mountain, a forest canopy, or the side of a ravine.
- Daytime lasts longer than the time the sun is visible in the sky. It begins a little while before the sun rises and ends a little while after the sun has set.
- Interiors of huts, tents, caves, gorges, forests, etc., can be illuminated from skylight. It is not necessary for sunlight to shine directly on something to have sufficient illumination to see it.
- It is brighter in the daytime when the sun is visible, but it is also brighter at night when the moon is visible (and brightest at night when the moon is at its fullest).
- The moon may appear in the daytime as well as at nighttime. On some days it appears both in daytime and at night, so there’s no apparent cause-effect relationship between the moon and night.
- The sun may provide light and heat, but so does a fire. A fire can even provide more heat than we feel from sunlight. Yet a fire does not turn nighttime into day. Why should the sun, being of a lesser intensity than a fire, be expected to do so? We know from our experience with campfires, torches, and oil lamps that heat from a fire is most intense in close proximity, and the warmth drops off with distance. Therefore, the sun must be pretty close, since we can feel its warmth.
- The sun occupies a very small area of the entire sky dome, yet the sky is uniformly lit on a clear day. Why should one assume that a tiny spot in the sky is responsible for lighting the entire expanse?
Might we not conclude from simple observation that daytime and sunlight are two separate and distinct phenomena, just as nighttime is separate from moonlight? And just as a fire can provide light and heat, yet not change night to day, cannot the sun be merely a supplement to daylight and daytime warmth--a "greater light to rule the day"--but not a cause of the day, while the moon provides light at night without causing the night?
From a primitive perspective it could very well seem that day and night could exist without need of the sun. And that’s about as good an answer for origins as you’ll get from any of Genesis.