Perhaps "East Wind, West Wind", a 1972 novelette by Frank M. Robinson. You might have read it in Nova 2, an original stories anthology edited by Harry Harrison which has been issued with various covers, or in the 1975 anthology Science Fiction Novellas edited by Harry Harrison and Willis E. McNelly.
A hidden illegal petrol car,
He pressed a button on his desk and the wall opposite faded into a map of the city and the surrounding area, from the ocean on the west to the low-lying mountains on the east. He waved at the section of the city that straggled off into the canyons of the foothills. "Internal-combustion engine—someplace back there." His voice was stronger now, his eyes more alert. "It isn't a donkey engine for a still or for electricity, it's a private automobile."
I could feel the hairs stiffen on the back of my neck. Usually I drew minor offenses, like trash burning or secret cigarette smoking, but owning or operating a gasoline-powered automobile was a felony, one that was sometimes worth your life.
"The Sniffer in the area confirms it," Monte continued in a tired voice, "but can't pinpoint it."
driven at night only,
Forest Hills, the part of the city that Monte had pointed out, was wealthy and the homes were large, though not so large that some of them couldn't be hidden away in the canyons and gullies of the foothills. If you lived on a side road or at the end of one of the canyons it might even be possible to hide a car out there and drive it only at night.
[. . . .]
But still, a number would have tried, I thought. They might even have stockpiled drums of fuel and some spare parts. In the city, of course, it would have been next to impossible. But in remote sections of the country, in the mountain regions out west or in the hills of the Ozarks or in the forests of northern Michigan or Minnesota or in the badlands of the Dakotas . . . A few would have succeeded, certainly, and perhaps late at night a few weed-grown stretches of highway would have been briefly lit by the headlights of automobiles flashing past with muffled exhausts, tires singing against the pavement . . .
[. . . .]
"You can sit in it if you want to," Dave said softly. "Just don't touch anything." His voice was soft. "Everything works on it, Jim, everything works just dandy. It's charged and if you wanted to, you could drive it right off the showroom floor."
I hesitated. "People in the neighborhood—"
"—mind their own business," he said. "They have a different attitude, and besides, it's usually late at night and I'm out in the hills in seconds. Go ahead, get in." Then his voice hardened into command: "Get in!"
as no gas left in the world
No, the problem wasn't a gas shortage, it was severe pollution:
It wasn't going to be just another bad day, it was going to be a terrible one. The inversion layer had slipped over the city four days before and it had been like putting a lid on a kettle; the air was building up to a real Donora, turning into a chemical soup so foul I wouldn't have believed it if I hadn't been trying to breathe the stuff.
I think I remember, a detective or police officer had a gun fight in the dark warehouse with the owner.
I dropped to the floor then, rolling fast to hit the shadows beyond the circle of light. His Mark II sprayed sparks and something burned past my shirt collar and squealed along the concrete floor. I sprawled flat and jerked my own pistol out. The first shot went low and there was the sharp sound of scored metal and I cursed briefly to myself—I must have brushed the car. There was silence and I scrabbled further back into the darkness. I wanted to pot the light but the bulb was still swaying back and forth and chances were I'd miss and waste the shot. Then there was the sound of running and I jumped to my feet and saw Dave heading for the door I had come in by.