I never realized this until both teams played home series on 9-10 June 2015 (and continuing on 11 June 2015, for the Mets), but apparently when the Yankees play at home the Mets play away, and vice-versa. What's the reason for this? And has it always been this way? What about when the Dodgers and Giants were located here?
I can find little official as to why they play opposite. Many possible reasons exist; the most logical seems simply to make it so the maximum total games can be attended by those who are fans of both teams (I'm sure there are a few), and in particular businesspeople who take out visitors or clients to games are most likely to have a game available to take their clients to.
I'm not sure that the other reasons givem by @Braamstruik in the comments really apply to baseball; Shea Stadium and Yankee Stadium are not particularly close, and police presence at baseball games is fairly minimal at most times (compared to the size of the total NYPD force, anyway), though perhaps it is a consideration. Chicago does not have this concept of home and away alternation with its two teams; the Cubs and White Sox regularly play at home on the same day, though they do usually have home openers on different days than each other.
The only real discussion I've found online of this topic is articles about the 2013 Home Opener which was for the first time since the 1950s held on the same day for both teams. Reasons for that occurence were that with the 15 team league and interleague play, it was more difficult to keep that aspect of scheduling.
As far as the other part of the question; during the period of 1903-1957, there were three teams in New York (the Yankees, the Dodgers, and the Giants), and so they certainly could not have had consistently played a similar schedule, though I imagine they didn't very often have all three playing home dates on the same day (just by coincidence if not by intent).