For these purposes, pre astronomy, your expanding borders essentially converts the ocean squares in your borders to coastal for commerce and travel. So, if you expand to abut a coastal square on a neighboring land mass you have access to both. However, this can be a one-way door for travel. Civs on the other land mass cannot cross until they expand borders to a coastal square on your land mass.
But commerce can flow, at least from your end to their cities. I haven't checked to see if they can get trade without access to the coast, but I assume trade is a two-way street. I've never confirmed that.
So, if you get in such a spot, it is sweet, as you can trade tech with civs on 2 land masses whilst they can only trade on one (might be possible for them to make contact if they each have units facing down over a single, non-traversable ocean square).
Theoretically, you could have one of these one way doors shut on you if a civ on the other side expands his borders pushing yours back from the coast.
Another not quite related situation, if you have an opponent's borders between you and no border agreement you can't travel through but commerce gets through so long as you are not at war with the interceding civ.
I think these statements are correct. I am always failing to see consequences in advance. Old age. I've gotten to the point that I can sit down to watch a movie with my wife only to discover halfway in that I'd seen it before.