I had a situation at work after an employee was terminated and the phone had two different passwords (one to unlock and another to erase). Not sure exactly which method I used then but a simply google search brought up the following, in any case I know it can be done (proceed with caution as I have not tried this exact method).
Start iTunes, making sure you are connected to the Internet.
Connect your iPhone to your computer with the USB connector cable.
Hold down the Home and Sleep/Wake buttons on the iPhone until the Apple logo appears. Release the Sleep/Wake button but keep holding down the Home button. The iPhone eventually should show you a connector icon pointing toward the iTunes logo to show the iPhone is ready to sync.
Locate your iPhone under the Devices heading in iTunes and select it.
Click the Summary tab. Select "Restore" option and then click "Back Up" when prompted if you haven't yet backed up the iPhone data. Click "Restore." Wait until your iPhone displays a message that says "iPhone is activated." iTunes will prompt you to set up the iPhone. (If iTunes doesn't do this, select the Sync option.) Choose the "Restore from the backup of" option and choose the latest backup you have. Click "Continue." Your previous passcode should now be wiped, allowing you to reset it.
If you can't remember the Passcode, you need to restore the device from the computer it was last synced with by placing the device in recovery mode.
Instructions here > iOS: Unable to update or restore
If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.