Yes as per Qatar Labor Law u should get NOC or you can approach the labor Court.

U will get it since u joined the second co. with a NOC letter and the 2nd co. did not sponsor your original visa.

Hope this answers ur question..