Except in the case of amounts attributable to (and not in excess of) deductions allowed under section
213 (relating to medical, etc., expenses) for any prior taxable year, gross income does not include amounts referred to in subsection (a) if such amounts are paid, directly or indirectly, to the taxpayer to reimburse the taxpayer for expenses incurred by him for the medical care (as defined in section 213(d)) of the taxpayer, his spouse, his dependents (as defined in section
152, determined without regard to subsections (b)(1), (b)(2), and (d)(1)(B) thereof), and any child (as defined in section 152(f)(1)) of the taxpayer who as of the end of the taxable year has not attained age 27. Any child to whom section
152
(e) applies shall be treated as a dependent of both parents for purposes of this subsection.