There can only be one OpenGL context active at any time, so you have to fully shut down either engine when you switch between them. Even then, both engines weren't designed to be cooperating with other render engines, so it may as well prove impossible.
For example caching mechanisms may be a problem, in particular because cocos2d uses Singletons all over the place to keep things cached in memory. I would attempt to make sure that all the essential cocos2d Singleton classes are released from memory before switching back to Unity.
The question here is rather why you would even want to mix two separate render engines in the first place? For one, Unity has a 2D toolset in itself. So your time is better invested by researching how to do whatever you need to do in 2D with Unity's own 2D toolset, or by emulating 2D in Unity's 3D renderer as many other games have done successfully in the past.