The Seven Year Itch, starring Marilyn Monroe and Tom Ewell, was filmed between September 1st and November 4th, 1954—and although its action centered around a New York City apartment, it was mostly shot in Hollywood. There were a few scenes filmed here, however—including that shot of Monroe standing over a subway grate. That ended up being more of a photo opp, however, since the crowd was too distracting and loud to capture anything usable. That first take was shot at 590 Lexington Avenue, at 52nd Street (the one used in the film was from a sound stage).
The apartment building, where the two characters meet, is at 164 East 61st Street—but only exterior shots were filmed there. In one scene you can even see Ewell walking home with an elevated train passing by (presumably the 3rd Avenue Line). The building now houses medical offices and apartments (more current images can be found here), but the tree seen in the movie is still standing!
See more Marilyn in New York photos here.