Hi and welcome to Just Answer!First of all - there is no capital gain recognized for transaction inside your 401k plan.For tax deferred amounts - such as 401k - only distributions are taxable - however distributions are taxable as regular income - and not as a capital gain.Generally - you may do either sell shares inside your 401k and transfer funds to a charitable organization or transfer shares directly to a charitable organization. In case of transferring shares directly to a charitable organization - fair market values of shares will be treated as distribution. However - while the law allowed transferring shares - you need to verify with your 401k administrator - all 401k plans are different and have different rules - so your broker might be correct.
The qualified charitable distribution provisions allow individuals age 70 1/2 or over to exclude from gross income up to $100,000 that is paid directly from their individual retirement accounts to a qualified charity.As you are 69 now - I might suggest waiting some time till you will be at least 70 1/2, transfer funds from your 401k plan to the IRA account - and you may accomplish the qualified charitable distribution without including distributed amount into your income.Let me know if you need any help or clarification.
If you take a distribution before age 70 1/2 - you will have to include the full amount of distribution into your taxable income, then you will be able to deduct your charitable contribution if you itemize.Because of large charitable contribution your deduction in the current year might be limited.