「隣」was originally an administrative unit of a group of households in ancient China, relating to the size of villages/towns/cities. This definition was extended to mean neighbour. The orthodox structure「鄰」is comprised of semantic「⻖/邑」(town, city) and phonetic「[粦]{りん}」.
This structure is important for the explanation, as「⻖」is the おおざと component on the right rather than the こざと component「阜」on the left.
「阜」depicts a row of hill mounds, used in characters to do with hills or arrays, e.g.
- 「陰/陽」, north/south side of a hill
- 「阪」, slope
- 「隊」, team/group ("an array of people")
- 「陣」, battle formation ("an array of war chariots"「車」)
In Japanese, the variant structure「隣」was chosen as the standard which switched「⻖」to the left hand side, so you'll have to make an exception in this occurrence of「⻖」.
「粦」only contributes to sound, not meaning, in this character. As far as I can recall, the only character where「粦」contributes etymology (and hence meaning) is「燐」(phosphorus).
「粦」was the original character of「燐」, which refers to the will-o'-the-wisp/ignus fatuus ghost fire phenomenon, where green lights are seen around decomposing bodies. The modern meaning phosphorus of「燐」is due to much of the decaying organic compounds containing this element.
「粦」was originally comprised of「大」(frontal view of an adult > big), representing a decaying body, and additional small markings around it, indicating will-o'-the-wisp lights.
Later on, feet*「舛」were added, and the body + dots were corrupted into「炎」and then further corrupted into「米」.
*「舛 : まいあし」refers to the bottom component ([足]{あし}) of「[舞]{まい}」; the meaning opposing > contrary is an extension of「舛」depicting a pair of (opposing shaped/left + right) feet.
References: