but listen to me, it also happened to me against a friend. I kept on losing against him, always got close but never won. Made stupid errors that i did not make against others. Until I won my first set 6-4 and then the match.
My tips are:
1) Stay Calm. Don't get too anxious.
2) Don't think in your opponent, but think in yourself. Your shots, your plays, etc.
3) Believe that you can win, and you will. And from then onwards, I bet you'll be the winner of the match most of the times.
If this does not work, maybe try to switch surfaces into one that suits you the best. For example, I know for sure, that if I play my friend in hardcourt he will stand no chance. Now we always play in clay, so it is easier for him, but it is best for me in fast courts.
Hope I was helpful,