No. Social Security defines “earned income” as wages from a job or net earnings from self-employment, and it only counts earned income in its calculation of whether and by how much to withhold from your benefits. It does not take into account pensions, retirement-account distributions, annuities, or the interest and dividends from your savings and investments.
By the same token, contributions to your IRA or 401(k) cannot be deducted from income for purposes of the earnings test. Social Security uses your gross income before tax-deferred allotments to determine your earnings.
Keep in mind
Income from all sources does go into determining whether and what portion of your Social Security benefits are taxable.