No accessory buildings shall be erected or altered so as to encroach upon the front, side or rear yards required by this chapter, except that a detached garage used solely for garage purposes and erected five feet from the rear line of the plot, may if necessary for accessibility, encroach on a side yard, but may not reduce the width of the side yard to less than five feet.