I did exactly just this. Ran the NYC Marathon as a training run for Philly. My advice is only do this if you know you can avoid getting caught up in the excitement of the first marathon. I don't think there's much of a different between a 23-24 mile training run and using a full as your last long run. The biggest risk is going too fast.
Personally I ran 3:18 in NYC, probably would've been better off with a 3:20-3:25 and then came back 3 weeks later and hit my goal of breaking 3 at Philly (2:57). So it's doable. I'm not sure if I lost or gained time by using this strategy but it was a lot more fun than doing a non-race last long run so it was worth it to me since enjoying running is what its all about.
Best of luck to you!