If you performed the work in MA, then you are subject to MA tax on all your earnings during that 2 month period. That would include the earnings from your DC employer, and DC contract since you performed that work remotely from MA.
Unless you earned very little during that period, you are required to file a MA return.
If you're a nonresident with an annual Massachusetts gross income of more than either $8,000 or the prorated personal exemption, whichever is less, you must file a Massachusetts tax return. If single or married filing separately, the personal exemption would be $4,400 (prorated amount for 2 months would be $733). If married, filing jointly jointly, it would be $8,800 ((prorated amount for 2 months would be $1466).