In the case of a consent dividend which, if paid in money would be subject to the provisions of section
1441 (relating to withholding of tax on nonresident aliens) or section
1442 (relating to withholding of tax on foreign corporations), this section shall not apply unless the consent is accompanied by money, or such other medium of payment as the Secretary may by regulations authorize, in an amount equal to the amount that would be required to be deducted and withheld under sections
1441 or
1442 if the consent dividend had been, on the last day of the taxable year of the corporation, paid to the shareholder in money as a dividend. The amount accompanying the consent shall be credited against the tax imposed by this subtitle on the shareholder.