While the cabs have been prohibited in the past from taking pre-arranged rides, testing an "e-hail" system is OK to see whether it leads to a dearth of cabs or other problems, Manhattan state Supreme Court Justice Carol Huff wrote in dismissing a lawsuit filed mainly by livery cab owners.
The judge also lifted an order that had temporarily blocked the program, but it wasn't immediately clear how soon virtual hailing might begin.
Taxi and Limousine Commissioner David Yassky saluted the decision as a victory that expands riders' choices.
"The market will ultimately decide which apps rise or fall, and we have an obligation to give the riding public that choice," he said in a statement.
A lawyer for the livery cab owners, Randy Mastro, said they were considering an appeal.
"This decision is so fundamentally wrong in so many respects," Mastro said by phone, declining to elaborate.
The Taxi and Limousine Commission agreed in December to test the idea for a year, saying the city couldn't ignore evolving taxi technology. E-hail systems are in use in some other cities, and at least a dozen companies said they were ready to provide the service in New York.
One of them, Uber, applauded the court decision as a win for a city seeking to cultivate a technology-friendly reputation.
"You can't stop progress when the people want it enough," CEO Travis Kalanick said in a statement.
Using an app, a potential passenger requests a ride, all participating cabbies within a certain distance get the inquiry and the driver who responds first gets the fare.
Car service owners said it unfairly blurred a legal line between yellow and livery cabs, which are barred from picking up passengers on streets and so depend on prearranged rides.
The livery cab owners - and a senior citizen who doesn't own a smartphone - also envision in the suit that e-hailing will leave people standing on street corners while cabbies zip by to pick up app-arranged fares, potentially reviving concerns about discrimination against passengers based on their race, whereabouts or destination. Those concerns led years ago to measures that barred drivers from taking fares via radio dispatch and from refusing any passenger without "justifiable grounds."
The judge, however, said the e-hail plan might actually combat any discrimination, since drivers wouldn't be able to see their fares when accepting them. She didn't address whether cabbies might shun some neighborhoods to take e-hail requests elsewhere but noted the test program could examine discrimination.
She suggested the electronic system could help, rather than harm, older people by "reducing time spent standing or walking" to find a cab. She also rejected other claims, including an argument that the program was too broad to qualify as a test.
The city's chief lawyer, Michael Cardozo, said the ruling confirms the city's position that the program is entirely proper.
Meanwhile, the state's highest court, the Court of Appeals, was poised to hear arguments Wednesday over a nearly opposite initiative: a plan to let livery cabs pick up passengers on streets in upper Manhattan and the city's four other boroughs.
In that case, yellow cab owners sued. They said the plan would hurt their business. Mayor Michael Bloomberg has countered that it would make travel safer, easier and cheaper for millions of people.
The outcome could have a major impact on the city's budget, as the disputed measure is coupled with a proposal to sell 2,000 new yellow-cab permits, or medallions. Officials have estimated that could make the city more than $1.4 billion over several years.