Oscar Morel, of Brooklyn, was charged over the deaths of imam Maulama Akonjee and Thara Uddin.
The 35-year-old faces up to life in prison without parole if he is convicted of killing the men in a brazen daylight attack on Saturday.
Morel appeared before Queens Criminal Court cuffed at the hands and feet, wearing a tan button-down shirt with black pants.
He was arraigned on one count of first-degree murder, two counts of second-degree murder and two counts of second-degree criminal possession of a weapon.
Morel appeared calm and spoke little during his brief appearance. He agreed that surveillance video showed him at the scene of the murders earlier on Saturday, but denied being the killer.