A black hole is an area of spacetime which exhibits a very strong gravitational field around it. The gravitational field is so strong that even light can't escape it.
There are two parts to a black hole. The center which is called the singularity.
The Event Horizon, which is the boundary around the singularity till where no matter can escape.
In the movie, they need information from inside the black hole. When they say inside, they are talking about inside the Event Horizon. Cooper does cross over inside the Event Horizon after which he is safely transported to the tesseract.
(There is a lot of arguments here on how Cooper survived, some are here : Interstellar Plot Holes).
It is important to note that the tesseract was inside the Event Horizon and not outside because that is the data that they need to solve the "Gravity Problem" back on Earth.
After transmitting the data obtained from inside the black hole (inside the boundaries of the Event Horizon) from tesseract, the 5d beings safely transport Cooper to the mouth of the worm hole near Saturn where he gets picked up.
(Apparently, "safely transport" has a warped meaning for the 5d beings, may be they forgot that it's not very safe to just chuck a human into open space for a passing space ship to pick up ;) )