This is the map
Each room is drawn with a colored square around it. Each room has colored dots at the sides indicating to what room you'll go if you follow that path. (These colors and dots do not correspond to anything in the game, but are only my way of making a readable map. Landmarks are marked to give visual cues to where you are.)Never assume that if you just turn around and go back the ay you came that you'll be ok, because not all rooms work that way. But they will always take you to the room I've indicated with the colored dots.
You're in Room 4 - Green Square. You go off screen bottom into Room 5 - Blue dot. Now you look at the Room 5 map. Ah, the Courtyard if off Screen right.
You go through into courtyard, but don't want to be there, if you exit courtyard screen left (the direction you came from) you won't return to Room 5. You'll end up in Room 6 - Purple room.
Follow the COLORS and DOTS.