Yes you have to sell it with the OS it was bought with. Internet Recovery (cmd+alt+r) will download the latest version of that and has the Disk Utility to delete everything.
But don't forget to sign out everywhere, especially iCloud in the System Preferences and deactivate the Mac in iTunes (for not blocking 1 of the 5 devices), also i would precautionally sign out of Messages, FaceTime and the App Store.
On icloud.com you can delete the Mac and if you have it registered in your support profile with the serial number you should delete it there too, so that the new owner can register it without calling the Apple hotline.
Edit: If the installer does not ask for your Apple ID before starting the installation then you know that is not connected to your Apple ID by iCloud anymore.
After the main installation part has finished and asks for the country, you can just turn it off by holding the power button a few seconds. It will get right back there when it is powered on again.