Payment of any tax on salaries, wages, commissions, other compensation or on net profits of business, professions or other activities to a political subdivision by residents thereof pursuant to an ordinance or resolution passed or adopted under the authority of this chapter shall be credited to and allowed as a deduction from the liability of such persons for any other like tax respectively on sal