No - distributions from a 401(k) are exempt from the penalty if they are made to an alternate payee in response to a Qualified Domestic Relations Order (QRDO). Be careful to submit the correct paperwork - for example, you will have to submit the QRDO from the court to the 401(k) plan administrator. Here's a web site with some advice on how to do this properly:
401(k) And Divorce