Board Thread:General Discussion/@comment-4845704-20170516034904/@comment-27060727-20170516040240

The epilogue occured after season 4's events. You pretty much laid it out.

Looking at how old Alice's daughter looks in the epilogue, ~5 years must have passed since the events of OUATIW. 5 years did not pass between season 2 and season 4 of OUAT, so we are to assume that Will & Ana somehow got separated from one another after Cyrus & Alice's wedding, Will ended up back in Storybrooke, but years later made it back to Ana and they lived happily ever after in Wonderland.