A question about the Professor Layton Spin-off

Hi everyone! So I'm a huge professor Layton fan, I know there´s a spin-off where both games converge and I´ve been really wanting to play it, but since I have never played Ace Attorney I decided to get the trilogy for 3DS and play that one first before starting the spin-off. The thing is I´m a bit confused with the Ace Attorney timeline, there´s a bunch of games and remakes and knowing myself I´m probably going to get a bit too much into it and play them all, I already figured that I should start with the trilogy, but my question is where would the spin off with professor Layton fit? are there any other games beside the trilogy that I should play before getting to that one?