When receiving social security benefits subject to an earnings limit, will Traditional IRA contributions allow me to offset my earnings to avoid penalty for higher income

Example:  If the earnings limit is $10k & actual earnings are $15k, will a $5k IRA contribution allow me to avoid being penalized for earning too much.