As others have said, check with your doctor before taking on a new exercise regime esp. because you say that you are overweight and concerned about your knees. I also agree with @Jeremie that a sports physical therapist or physiotherapist can help you with a specific program for your knees. Often strengthening the hip muscles (glutes) helps to minimize knee pain. You could then incorporate these exercises in your gym routine.
As for squash, it requires quick starts and stops. This can be hard on the knees. If you have access to a pool, you could do sprints in waist deep water to condition your legs for the quick acceleration and deceleration needed.
A dynamic warm-up is important to get your body parts ready for the quick movements.
The quick push off can also be hard on the quads, hamstrings, calf muscles and Achilles tendons. A regular stretching program and after you play will help prevent injury and give you the flexibility you need. The following questions/answers have specific stretches:
BTW, squash is fun and a great way to exercise for weight loss. The quick intense bouts are like intervals.