You can't stop your ally from charging the boss, so work with it instead. Here's the plan: run toward the boss, and the moment it starts to move, dash back to the button. Your ally will get stabbed in the process.
Press 'e' to close the door while the boss is underneath it, crushing it. Raise the door again, and the boss is done. Run over to your ally and hold 'e', then make your way to the rocket ship. Getting him up the stairs is the hardest part, but keep at it. Do all that, and you've beaten the game. Congratulations!