IIRC, after 5 incorrect attempts, the lockscreen should show you a "forgot password" button (or something like that). Clicking that should allow you to enter your gmail Id/password - and if you enter that correctly, it should let you change your password/pin
Other than that, a factory reset may be your only option.
Edit: the "forgot" button should show up if you forget the pattern - hopefully, it works the same way if you use a pin/password instead.
You can search the play store for an app called Screen Lock Bypass Pro - but I don't know if it works