Go to the Estimates and Other Taxes Paid section of Deductions and Credits on your federal return. Click on the Estimates sub-heading. There you will find the section for entering State Estimated Taxes. Enter the withheld MD taxes there.
From the instructions for form MW506NRS:
Nonresident individuals are required to file a
Nonresident Maryland Income Tax Return (Form
505). The income tax withheld and reported on
Line 8 of the Form MW506NRS must be claimed
as an estimated income tax payment.