I'm a sub of a subcontractor on a large commercial project. I'm in contact with the GC as well. My client got paid from the GC but we didn't received our payment from our client.
The short answer is yes. If the party contracting with you has not paid for your work then it is in breach of the agreement. If the amount is $8,000 or less then you can go to small claims court without a lawyer. If more, I suggest that you consult with a lawyer about the matter.
There are a variety of cash flow solutions for consideration when payment is not delivered as contracted. In summary, solution options can only be determined after critically assessing the facts, the relationship of the interested parties, and leveraging the law.