Which device? What version of Android OS?
I don't think you can do what you asked for, but you probably don't need to: after five failed PIN code attempts, you should see a "forgot passcode" button - tap that and you will be given the opportunity to enter your Google password.
Try it.