High-velocity gas at intermediate latitudes and its relation to the outer part of the Galaxy