Correct repayment amount when claiming the tax credit for the overpayment

Hi there,

 

 I was notified by my former employer that I was overpaid in 2023 by their mistake. The gross pay amount is around $5200 and the net pay amount is around $3100. I repaid them the amount of net pay ($3100) in 2024.

 

I am preparing my 2024 tax return and want to claim the tax credit for the repayment since the amount of the repayment is greater than $3000. My question is which is the correct amount, $5200 or $3100, when I determine the overpaid tax in 2023? 

 

Thanks!