Answer:
The two Middle Eastern powers in question are Turkey and Iran, and they are on opposing sides because they have different political interests.
Step-by-step explanation:
The Syrian War started off as an internal conflict. The conflict started off as a revolution against the government of Assad, but it soon became a conflict in which military forces from around the world got involved too. As it happens in most cases, so foreign countries supported one side while other countries supported the other side.
This has been the case as well with the two regional powers of Turkey and Iran. Turkey has been on the side of a fraction of rebels, while Iran has been firmly standing on the side of the government. It shouldn't really come as a surprise when considered the different interests of these two countries. Turkey wants to have full control over its border because millions of people are potential to its unity, while Iran has Syria as the only ally in the region and it gives its best to keep it alive.