I have a loss carryover of $4000 from 2022. If I make $1000 in cap gains in 2023, will I offset all gains + get $3000 deducted from income for 2023?

As mentioned in the title.

Lets say in 2022, I have cap loss of $7000. I was able to use $3000 for tax loss harvesting. $4000 is carried over to 2023. Let's say in 2023 I make $1000 in cap gains. Will I be able to use the $4000 loss carryover to negate the gains AND get a $3000 deduction from income? Or will I only get a $2000 deduction?