まぐれ ＝ by chance
This has a meaning similar to ぐうせん & たまたま but can’t be used in this kind of sentence:
By chance I met a friend.
I learnt the word while playing pool: meaning lucky/fluke/by chance:
[Credit to じゅん – sorry I had to whoop you at pool (o^-‘)b ]