Demetrius Blackwell, 35, appeared before a judge Sunday and did not enter a plea.
Officer Brian Moore of the New York City Police Department's Anti-Crime Unit was being treated at Jamaica Hospital Medical Center, where he had emergency surgery, Police Commissioner Bill Bratton told reporters Saturday.
Moore, 25, and another officer, Erik Jansen, 30, were sitting in an unmarked police vehicle in Queens when they saw a passerby adjusting something in his waistband.
Moore, who was driving, pulled up behind the man, later identified as Blackwell, 35, to ask about it, Bratton said. Blackwell allegedly pulled a gun from his waistband and opened fire on both officers, who were in the car and had no chance to fire back.
Blackwell has been charged with two counts of first-degree attempted murder on a police officer, one count of aggravated assault on a police officer, two counts of second-degree criminal possession of a weapon and one count of first-degree assault.
Blackwell's attorney, David Bart, told CNN that it wasn't unusual for no plea to be entered at this stage, saying that in "a case like this, the court rarely asks for one at this time."
"I don't think anyone should rush to judgment," Bart said. "I'm still working and looking into things."
"Last night's shooting once again reminds us of the dangers that our police officers face each day as they carry out their sworn duty to protect and serve our communities," Queens District Attorney Richard A. Brown said in a statement.
If convicted, Blackwell faces 15 years to life in prison.
The suspect fled after shooting at the officers, but was apprehended shortly after.
A doctor said it could take as long as two days to determine Moore's prognosis.
Blackwell's attorney, David Burt, did not immediately return CNN's call for comment.