Basically I see two challenges you are going to have with this and with those your better option is probably to use a QueryDataSource for this.
First, if I am understanding you correctly, you could have a many-to-many relationship with this call (i.e. multiple teachers selected to show on a course page RELATED to some teachers pages). The PagesDataSource and really the process are not meant to handle this fundamentally. If it was just one teacher to one course, you could use the PagesDatasource and set the WHERE clause to 'custom_course.Teacher IN (SQL Statement Querying the custom_teacher page type table)', but since it is many I do not think this will work, but you can try and prove me wrong :) (just do not have time to try it)
Instead I would create a custom query that you pass the custom_course ID field to in the WHERE clause. This query would select all the teacher IDs from the custom_course table and then pull up the fields you need from the custom_teacher table. Its going to be a complex query, but be your best for automating the process going forward.
Your other option and just a thought, is to tie the course to the teacher instead of your way (not ideal I realize) but would be a much easier query on the course pages.
Anyway probably not the answer you were looking for, but maybe try the IN command in the WHERE clause first to see if that works and please let us know what you do (whether I helped or not) so we can all learn from it!