this is a GREAT QUESTION. brooklynites LOVE to talk about brooklyn.
it depends entirely on what you need/want in a neighborhood. why do you have to be on the 2/5 line? where do you live now?? if park slope is too expensive for you then brooklyn heights probably is too. certainly consider prospect heights. (probably also astronomically expensive…)
also, if you’d like to be near a park, there’s a very small park in fort greene (“fort greene park”) which is super hip, as neighborhoods go, & kind of near the atlantic ave station which certainly has the 2 & 5 trains, in addition to almost every other train in brooklyn (& the LIRR!!).
i live along the B/Q line on the other side of the park from park slope (ditmas park, or kensington), in a neighborhood that breedmitch mentioned, which IS up-&-coming (see: bars, coffee shops, european-influenced restaurants).
good luck!