Dying Miata

I have a 1991 Mazda Miata. Lately, when I pull up to a stop, the engine will drop to a very low idle and usually stall - UNLESS, the headlights or parking lights are on! Then, the idle is just fine. Any clues? The car has approx. 146k miles, and otherwise runs great.

p.s. - the car is a 5 speed manual.

When was the last spark plug and wire change? This car needs them changed about twice as often as other cars. How bout the fuel filter? Ever changed?

Check the air intake plumbing for cracks. Clean the throttle body, idle air control valve and MAF sensor. Does this engine need valve adjustment? Get a compression test.

Good suggestions! Thanks, Joe and circuitsmith.
But - can anyone explain why the car idles fine and doesn’t stall out when the lights are on???

A possible grounding problem.

When you have a mysterious problem, a good place to start is any past due maintenance issues. Once those are out of the picture, it makes the troubleshooting easier.

On many cars the engine computer monitors alternator load and will raise idle speed to help maintain the current.

Next time try turning the heating/cooling fan on high instead of the lights.