Can the 10% penalty for early withdrawal from 401k still be tax deductible? If I’m eligible for an EV credit of $7500 can that cover the penalty?

I am eligible for the $7,500 electrical vehicle credit but I won’t owe $7,500 in federal taxes.  I’m considering taking a withdrawal from my 401k since I’ll have extra credits available to me.  If I take $10,000 (counted as income I understand) will the $1,000 tax penalty that results be deductible or do I owe that no matter what?