It is difficult to tell if the pincer at 3 was the right choice. Generally, such a wide pincer is good if you plan on a moyo on the right side. I'm assuming that W1 was in the upper left and B2 a hoshi in the lower right, as in this:
$$Wcm1
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . 1 . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . 3 . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . 4 . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . X . . . . . , . . . . . 2 . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------
On this board, B4 looks like a reasonable pincer. Typically, you'd expect something like this:
$$Bcm1
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . 0 . 4 2 8 . |
$$ | . . . O . . . . . , . . . . 5 X 3 6 . |
$$ | . . . . . . . . . . . . . . . . 9 7 . |
$$ | . . . . . . . . . . . . . . . . O . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . 1 . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . X . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------
Now the black right side has nice potential to grow big.
In the game, white chose the counter pincer instead, which is a good move (especially in handicap games). Your choice of the kosumi B5 was good, as it simplifies the game and leaves white less chances to start a complicated fight than other options (most notable the tsuke on top of W2.
White deviation from joseki was a mistake. Let's study why. First, one correct variation:
$$Wm1
$$ ----------------
$$ . . . . . . . . |
$$ . . . . . . . . |
$$ . . O 3 O O 7 . |
$$ . X 2 1 X X 5 . |
$$ . . . X 4 a 6 . |
$$ . . . . . O . . |
$$ . . . . . . . . |
$$ . . . . . . . . |
$$ . . . . . . . . |
$$ . . . . X . . . |
$$ . . . . . . . . |
Here, white first plays W1 to force black to play an empty triangle at 4. Next, white hanes at 5, and after W7, black would need to play at a to fix the shape. But that would leave black with a pretty heavy shape (too many stones used). This heavy shape is a direct result of the kosumi B5 in the original diagram, which often leads to shape troubles. This is still acceptable in handicap games, though.
Let's compare this with the game:
$$Wm1
$$ ----------------
$$ . . . . . . . . |
$$ . . . . . . . . |
$$ . . O . O O 3 . |
$$ . X . a X X 1 . |
$$ . . . X . 4 2 . |
$$ . . . . . O . . |
$$ . . . . . . . . |
$$ . . . . . . . . |
$$ . . . . . . . . |
$$ . . . . X . . . |
$$ . . . . . . . . |
In this variation black does hane at 2, followed by W3 and connect at 4. Note that white a does not threaten a cut anymore, because black already fixed at 4. Thus, black is less heavy, and the variation is a little bit worse for white than joseki.