Soaring gas prices and higher tolls seem to be doing for traffic in New York what Mayor Michael R. Bloomberg’s ambitious congestion pricing was supposed to do: reducing the number of cars clogging the city’s streets and pushing more people to use mass transit.

In May, with gasoline at more than $4 a gallon, traffic at the Metropolitan Transportation Authority’s bridges and tunnels dropped 4.7 percent compared with the same month the previous year.

Preliminary data for June shows a similar decrease in traffic, and officials say the change is largely because of higher prices at the pump.

The Port Authority of New York and New Jersey has recorded a similar decline in travel across its bridges and tunnels since early March, when it raised tolls. The greatest decline was in April, when traffic fell by 4.2 percent. (The transportation authority also increased tolls in March, but by a much smaller amount.)

At the same time, subway, bus and commuter rail ridership has increased.

Weekday subway ridership was up 6.5 percent in April, compared with the same month a year ago. April ridership increased 5.5 percent on the Long Island Rail Road, 4.3 percent on the Metro-North Railroad and almost 9 percent on PATH trains between Manhattan and New Jersey. Use of the subways and rail lines also increased in May, compared with the previous year, but in most cases by smaller amounts. New Jersey Transit ridership, including bus, commuter rail and light rail, was up about 4.6 percent in April and May combined.

“We’re at the point where people really are changing habits,” said Sam Schwartz, a transportation consultant. He said that if gas prices stayed high, the result could be close to the goal set by Mr. Bloomberg’s congestion pricing plan, which, if it had been approved, was expected to reduce traffic in much of Manhattan by 6.3 percent.

“If we start eclipsing $5 a gallon, which we might over the summer, I think we might get very close,” Mr. Schwartz said.

Throughout the country, rising gas prices have had a broad economic impact, hitting especially hard in many cities and suburban communities where people are more dependent on cars than in the transit-dense New York City region.

And while there is no denying that increased costs mean a certain pain for drivers in New York, they may also have the unique effect of meshing with the city’s goal of cutting traffic and, as a consequence, lowering pollution.

Bloomberg administration officials, however, said the actual impact may be slight.

“The magnitude here is by no means comparable to the effect that congestion pricing would have in reducing traffic,” said Bruce Schaller, deputy transportation commissioner for planning and sustainability.

Still, the new numbers do bolster a central point of the Bloomberg plan: that higher prices can motivate commuters to give up their cars.

“It shows that pricing matters and that people respond to it,” said Jeffrey M. Zupan, a senior fellow for transportation at the Regional Plan Association.

It is hard to say exactly what the impact of lighter bridge and tunnel traffic has been on the streets of Manhattan — or other boroughs — since the city does not take traffic measurements that show changes from month to month. But there are other indications.

The Metropolitan Parking Association, which represents garage and parking lot owners, said that its members had seen about a 10 percent decrease in daily customers. And gas station managers interviewed in Brooklyn, Queens and New Jersey said that the number of drivers buying gas had also declined.

Interviews with drivers and transit riders indicate, however, that a change in habits has not come easy — and might be reversed if gas prices fall.

“When prices went over $4, I stopped driving,” said Scott Pisciotti, 41, a real estate portfolio manager from Somers, N.Y. Mr. Pisciotti said he used to drive daily to his office in Midtown Manhattan but now rides a Metro-North train from White Plains to Grand Central Terminal. It is a new routine for him, and he has not fully embraced it. “If prices dropped,” he said, “I would drive a lot more.”

Commuter trains have also become more crowded, riders say.

At the Secaucus Junction train station of New Jersey Transit, Brian Simmons, 30, said that it had become much harder to get a seat on the train in recent months. “It’s like the New York City subway,” he said.

Gas price-induced traffic reduction might have a downside. Mr. Bloomberg’s plan was intended, among other things, to raise hundreds of millions of dollars a year for mass transit improvements by charging cars an $8 fee to enter the area of Manhattan below 59th Street. The plan was defeated in April when legislative leaders in Albany refused to bring it up for a vote.

In contrast, the current reduction in traffic at bridges and tunnels could actually take money away from transit, because a large portion of the tolls collected at the transportation authority’s crossings helps to finance the subways, buses and commuter railroads. In May, toll revenues were more than $4 million below budget projections, and Gary J. Dellaverson, the authority’s chief financial officer, said that June toll revenues appeared to be down even further.

So far, the drop has been more than offset by an increase in fare collections generated by higher transit and rail ridership, but Mr. Dellaverson said that the combination of slipping toll revenues and the increased cost of fuel for the authority’s buses and trains could eventually outpace ridership revenue gains.

The rise in gas prices may also be increasing something that congestion pricing was meant to eliminate: the incentive for drivers to avoid tolls by using the free bridges over the East River, causing heavier traffic in the surrounding neighborhoods.

The congestion pricing plan called for a 6.3 percent reduction in the total miles traveled by all vehicles in the pay zone. That is different from simply taking cars off the street since some vehicles, like taxis, are responsible for a higher share of the total miles driven. Mr. Schaller said that to achieve the program’s goal, the city would have needed at least a 10 percent reduction in the number of cars entering the zone.

Mr. Schwartz estimated that a 4 or 5 percent drop at the bridges and tunnels might mean just a 2 or 3 percent reduction in Manhattan traffic.

While some drivers have given up and switched to trains or buses, those who are sticking with their cars say they are driving less.

Singh Bridgemohan, 50, was putting some gas, at $4.35 a gallon, in his red 1996 Jeep Grand Cherokee on a recent morning at an Exxon station in Bay Terrace, Queens. Mr. Bridgemohan, who runs a small construction company, said he used to drive his wife, a nanny, from their home in Jamaica to her work in Bayside every day. Now he does it rarely, to save on gas, while she makes a much longer commute by bus.

At a Shell station on the New Jersey side of the Holland Tunnel, Peter Lin, 54, a sales executive from Holmdel, N.J., paid $56.18 to fill up his 2005 Toyota Camry before heading to work in Manhattan. Mr. Lin echoed several drivers who said that an unexpected benefit of higher driving costs was that there are simply fewer cars on the road.

“Do I like the traffic?” he said. “Yes. Do I like the cost of gas? Forget about it.”