You can add an hyperlink to your page and href value should be '/_layouts/AccessDenied.aspx?loginasanotheruser=true'. Please see the below example.
<a href='/_layouts/AccessDenied.aspx?loginasanotheruser=true' >Sign in as different user</a>
Check it out and let me know.