If you are looking for your own apartment and not a share, there are reasonable prices in Ditmas Park, Brooklyn, near the Courtelyou station on the Q train. It's a neighborhood full of many Victorian houses with yards, plus several large brick coop and apartment buildings. It's a pretty quiet neighborhood but has a few nice amenities. The Q train should get you to Union Sq in 25 minutes once you are on the train.
Ditmas Park Blog
Ditmas Park at the Newkirk Q station might also be a possibility. I've been there but never lived there - it seemed safe enough, just a bit quieter and kind of boring!! That would be about 30 minutes to Union Sq.
If you're looking for a share you would have more choices in terms of neighborhoods.