No, these are not at all the same thing. One has to do with the defendant's state of mind at the time of the crime and the other has to do with the defendant's mental abilities at the time of the trial.
A person is not guilty because of insanity if they are not capable of forming the intent needed to be guilty of some crime. For example, if you are unable to understand what you are doing, you cannot possibly be guilty of premeditated murder.
But that is not the same as being incompetent to stand trial. Incompetency has to do with whether a person understands the proceedings well enough to participate in them. It has nothing to do with whether the person was sane at the time of the crime.