It is difficult to imagine how asking could be unethical except, perhaps, in a situation where you knew beforehand that whatever you were asking the other party to do was a criminal offense.
Many database licenses that I have seen permit the license holder (e.g., a library or institution) to grant database access only to enrolled students, or to academic staff, or graduate students, or some other specified group. Sometimes, database licenses allow access to persons who live in a particular locality ... and there are some that allow access to people who already have some other sort of qualifying characteristic (such as being enrolled at a government-funded university). So go ahead. Ask. The recipient of your request can always refuse.
You might also consider contacting the database creator to find out whether there are any options for access that they can suggest.