That's quite a primitive and backward idea. Your logic is exactly what is wrong with today's world and it's the cause of massacres in Iraq and Afghanistan by the NATO. If Iraq were a Christian country, over a million people wouldn't have died in the war with no one in the Western world batting an eye.
As far as the humanitarian aspect of the war is concerned, people should always side with the victim. No matter what. If a Muslim country is bullying a Christian country, I will side with the Christian country for sure. As far as politics is concerned, people should side with whoever that their victory is better for their interests. In this case, both aspects of the issue point to the fact that Iran should support Armenia against a country that is openly hosting Israeli army (currently occupying Muslim lands) against Iran for over a decade.
Also, your logic is flawed. I wonder if it could be applied to India-China skirmishes as well. After all, India has 180 million Muslims while China has only 30 million Muslims and parts of India have been ruled by Muslims for a long time. So, they are indeed closer to us Muslims than the communist Chinese.