Nice necroing
This is pretty simple actually, look at
that link, under "Transfer to Bitcoin address"
When you create a transaction, Bitcoin checks if you can spend the transaction you're using as the income
It takes the scriptPubkey of the incoming tx and the scriptSig of the new one, which gives:
<sig> <pubKey that wants to spend the tx>
| OP_DUP OP_HASH160 <pubKeyHash target of incoming tx> OP_EQUALVERIFY OP_CHECKSIG (sig + pubkey from scriptSig, and the others things from the scriptPubkey)
To see how that is processed, look at the table in the link