마음을 나누다 = (lit) share your heart => have a heartfelt conversation / reach a rapport / confide in someone.
In addition to "to divide", 나누다 means having a meaningful exchange or communication in the form of talk, affection, laughter, a good time, and other things.