We know that Guinan's people previously engaged the borg in battle. Although Q's plot is clearly premeditated at some level, I think it is likely that Q chose to create an encounter with the Borg because of Guinan's experience. It seems possible that Q was inspired by her presence to make that choice. That seems to be amusing in a Q sort of way. "It's ...
According to what the Q have said, they appear in a way that the species they encounter can understand, sort of like Galactus does in Marvel. Being stereotypical male/female would be understandable by most species. That’s why their civil war was shown to Janeway as the American civil war. They knew she was from America and would get the references.
The question asks where Q got the idea to introduce Enterprise to the Borg. I disagree that Guinan prompted this. From the dialogue Q seemed irate that Pickard would question Q's judgement:
From the transcript
Q: Oh, the arrogance. They don't have a clue as to what's out here.
GUINAN: But they will learn, adapt. That is their greatest advantage.
Q hurled the Enterprise across the universe to combat what he perceived to be the sheer arrogance of Picard and Riker at rejecting his offer to join the crew. From the transcript
Q: Oh. Well, you may not trust me, but you do need me. You're not prepared for what awaits you.
PICARD: How can we be prepared for that which we do not know? But I do know that ...